Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

345
Visualizações
Launch Tor browser using Puppeteer instead of Chrome on Windows 10

I'm on a Windows 10 machine, I've downloaded the Tor browser and using the Tor browser normally works fine, but I'd like to make Puppeteer use Tor to launch in a headless mode, I'm seeing a lot regarding the Socks5 proxy but can't figure out how to set this up and why it's not working? Presumably when running the launch method it launches Tor in the background?

Here's my JS code in node so far...

// puppeteer-extra is a drop-in replacement for puppeteer,
// it augments the installed puppeteer with plugin functionality
const puppeteer = require('puppeteer-extra')

// add stealth plugin and use defaults (all evasion techniques)
const StealthPlugin = require('puppeteer-extra-plugin-stealth')
puppeteer.use(StealthPlugin())

// artificial sleep function
const sleep = async (ms) => {
  return new Promise((res, rej) => {
    setTimeout(() => {
      res()
    }, ms)
  })
}

// login function
const emulate = async () => {

  // initiate a Puppeteer instance with options and launch
  const browser = await puppeteer.launch({
    headless: false,
    args: [
      '--proxy-server=socks5://127.0.0.1:1337'
    ]
  });

  // launch Facebook and wait until idle
  const page = await browser.newPage()

  // go to Tor
  await page.goto('https://check.torproject.org/');

  const isUsingTor = await page.$eval('body', el =>
     el.innerHTML.includes('Congratulations. This browser is configured to use Tor')
    );

    if (!isUsingTor) {
        console.log('Not using Tor. Closing...')
        return await browser.close()
    }


  // do something...

}

// kick it off
emulate()

This gives me a ERR_PROXY_CONNECTION_FAILED error in chromium, why isn't it launching using Tor?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

There are lot more steps you need to take.

  1. You need to install tor on your system. You might want to use- brew install tor
  2. Start tor with- brew services start tor
  3. tor use port 9050 by default, so your proxy should look like this; --proxy-server=socks5://127.0.0.1:9050 If you must use another port, then it must be added in the torrc file. Also, you might need to do your //go to tor// before your //launch facebook//
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda