1

I am having trouble sending requests with proxies.

This is the code I am using.

 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 Is defined as http://ip:port (eg: https://31.13.15.107:81) Im getting the proxies from https://www.proxy-list.download/HTTPS https proxies

The requests don't go through and give me this error

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'

Are ssl/https proxies supported by request or are they just bad proxies?

Thanks,

  • You should have a look at this answer : https://stackoverflow.com/questions/3862813/how-can-i-use-an-http-proxy-with-node-js-http-client – Julien Revault d'A... Mar 17 '19 at 13:21
  • 1
    Did you test the proxy at the command line with curl, or in your browser first to confirm if it works before using it in your code? – madebydavid Mar 17 '19 at 14:02

0 Answers0