V
V
Valery Chupurnov2018-09-12 12:27:05
Google Chrome
Valery Chupurnov, 2018-09-12 12:27:05

How to make puppeteer work through socks5 proxy?

Good afternoon. I bought a proxy server, version socsk5. On the Internet, the same example is everywhere

const browser = await puppeteer.launch({
        headless: true,
        ignoreHTTPSErrors: true,
        defaultViewport: {...winSize},
        args: [
            '--proxy-server=socks5://proxyhost:8000',
            '--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE proxyhost"',
        ],
})

At the same time, the login password for this proxy is not set and it clearly does not work.
If you set it like this
'--proxy-server=socks5://user:[email protected]:8000',
then it gives an error
net::ERR_NO_SUPPORTED_PROXIES
Already bought an HTTPS proxy, and it also could not be configured.
I tried using https://github.com/sjitech/proxy-login-automator to build a bridge, but it didn't work either.
Please tell me where to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Dubrovin, 2018-09-13
@skoder

Set a local proxy that will not require authorization and forward to the parent, for example, in the 3proxy configuration something like
auth iponly
fakeresolve
internal 127.0.0.1
allow *
parent socks5+ proxyhost 8080 user password
socks -p1080
and use 127.0.0.1 1080 in the browser.
PS but in general it is better to use http/https proxies in browsers, they have a shorter handshake.

H
hOtRush, 2018-09-12
@hOtRush

An old sore
There are solutions on github:
- https://github.com/GoogleChrome/puppeteer/issues/426
- https://github.com/GoogleChrome/puppeteer/issues/676
- https://blog.apify.com/ how-to-make-headless-chrome...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question