A
A
alpha9172018-04-24 08:43:34
Node.js
alpha917, 2018-04-24 08:43:34

How to make an https request over sock5 using request?

At the moment the code is:

var request = require('request');
var Agent = require('socks5-https-client/lib/Agent');
request.get('https://google.com', {
            agentClass  : Agent,
            strictSSL   : false,
            agentOptions: {
                  "socksHost": "***",
                  "socksPort": ***,
                  "socksUsername": "***",
                  "socksPassword": "***"
            },
            headers     : {
                'Accept-Encoding': 'deflate, br',
                'Accept-Language': 'ru,en;q=0.9,en-GB;q=0.8',
            },
        });

and it returns a binary hash

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alpha917, 2018-04-24
@alpha917

A gziped response was returned. although only deflate and br were listed in the headers. However, the answer from Google could not decipher)

V
Vitaly, 2018-04-24
@vshvydky

request = request.defaults({'proxy':'http://localproxy.com'})

just open the documentation of the module

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question