Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

344
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!