【问题标题】:Specify SOCKS Proxy For NightmareJS?为 NightmareJS 指定 SOCKS 代理?
【发布时间】:2017-05-04 23:48:23
【问题描述】:

我可以为 NightmareJS 设置一个 HTTP 代理,但是如何指定类型 (http/socks5/socks4)?这是我用来设置 HTTP 代理的代码:

const nightmare = Nightmare({
            show:true,
            switches: {
                'proxy-server': proxyHost + ':' + proxyPort,
                'ignore-certificate-errors': true
            },
            waitTimeout: 400000
        });

【问题讨论】:

    标签: javascript proxy electron socks nightmare


    【解决方案1】:

    您可以通过 URI 方案指定代理的类型: socks5://

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

    【讨论】:

    • 是的,我昨晚才找到的。会接受。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多