I have the Tor Expert Bundle installed on my system and I’m trying to get it working with Puppeteer for web scraping. When I attempt to connect through the Tor proxy, I keep running into issues.
Here’s what I’m currently trying:
const puppeteerBrowser = await puppeteer.launch({
headless: false,
args: ['--proxy-server=socks5://127.0.0.1:9050']
});
However, this throws an ERR_NO_SUPPORTED_PROXIES error every time. The strange thing is that when I manually configure my regular Chrome browser to use the same Tor proxy settings, everything works perfectly fine. Has anyone successfully integrated Puppeteer with Tor before? What am I missing in my configuration?
had the exact same issue, but switching to --proxy-server=socks5://localhost:9050 did the trick for me. make sure tor is actually running on port 9050, it tends to change ports if it’s not configured right.
That ERR_NO_SUPPORTED_PROXIES error pops up because Puppeteer’s Chromium build doesn’t handle SOCKS as well as regular Chrome. I’ve hit this wall before - what works way better is running Tor with an HTTP proxy layer on top. Use Privoxy or Polipo to convert the SOCKS5 connection to HTTP, then just point Puppeteer at that HTTP proxy. Set Privoxy to listen on port 8118, forward it to your Tor SOCKS port, and use --proxy-server=127.0.0.1:8118 in your Puppeteer args. I’ve used this setup across multiple projects and it kills the SOCKS compatibility headaches completely.
This is a common problem with Puppeteer and SOCKS proxies. Chromium handles SOCKS5 differently than regular Chrome - that’s why it works in your browser but not with Puppeteer. I ran into this same issue last year. You need to add --proxy-bypass-list=<-loopback> to your launch options so Puppeteer doesn’t route localhost traffic through the proxy. Also try SOCKS4 instead - sometimes that works better with Tor setups. If you’re still having issues, look into using the tor-control-port interface or wrap an HTTP proxy around your Tor service.