javascript - Specify SOCKS Proxy For NightmareJS? - Stack Overflow

I'm able to set an HTTP proxy just fine for NightmareJS but how do I specify the type (httpsocks5

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
        });

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
        });
Share Improve this question asked May 4, 2017 at 23:48 xendixendi 2,5325 gold badges43 silver badges70 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11 +50

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

const nightmare = Nightmare({
    switches: {
        'proxy-server': 'socks5://' + proxyHost + ':' + proxyPort,
    },
});

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744411412a4572894.html

相关推荐

  • javascript - Specify SOCKS Proxy For NightmareJS? - Stack Overflow

    I'm able to set an HTTP proxy just fine for NightmareJS but how do I specify the type (httpsocks5

    6天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信