请求Node.js代理请求(发布)

时间:2019-03-17 11:20:24

标签: node.js proxy request

我无法通过代理发送请求。

这是我正在使用的代码。

 request({
    url: url,
    method: method,
    form: {
        'email': email,
              'password': password,
              'username': username,
              'first_name': firstname,
              'client_id': randstring('28'),
              'seamless_login_enabled': '1',
              'gdpr_s': '%5B0%2C2%2C0%2Cnull%5D',
              'tos_version': 'eu',
              'opt_into_one_tap': 'false',
   },

    proxy: proxy,
    headers: headers,
  }, (err, response, data) => {
console.log(err || response || data)
});

proxy定义为http://ip:port(例如:https://31.13.15.107:81) 我从https://www.proxy-list.download/HTTPS获得代理 https代理

请求没有通过,并给我这个错误

Error: tunneling socket could not be established, cause=write EPROTO 139896935475008:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:

    at ClientRequest.onError (/home/ira/node_modules/tunnel-agent/index.js:177:17)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketErrorListener (_http_client.js:401:9)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at onwriteError (_stream_writable.js:417:12)
    at onwrite (_stream_writable.js:439:5)
    at _destroy (internal/streams/destroy.js:39:7) code: 'ECONNRESET'

请求是否支持ssl / https代理,或者它们只是不良代理?

谢谢

0 个答案:

没有答案