Specify SOCKS Proxy For NightmareJS?
Asked Answered
K

1

10

I'm able to set an HTTP proxy just fine for NightmareJS but how do I specify the type (http/socks5/socks4)? Here's the code I use to set an HTTP proxy:

const nightmare = Nightmare({
            show:true,
            switches: {
                'proxy-server': proxyHost + ':' + proxyPort,
                'ignore-certificate-errors': true
            },
            waitTimeout: 400000
        });
Keratoid answered 4/5, 2017 at 23:48 Comment(0)
P
11

You can specify the type of the proxy via the URI scheme: socks5://

const nightmare = Nightmare({
    switches: {
        'proxy-server': 'socks5://' + proxyHost + ':' + proxyPort,
    },
});
Propst answered 19/5, 2017 at 15:12 Comment(1)
Yeah, I just found it last night. Will accept. Thanks.Keratoid

© 2022 - 2024 — McMap. All rights reserved.