Answer the question
In order to leave comments, you need to log in
Error "tunneling socket could not be established", how to do it right??
making a request
const req = require('request');
var options = {
url: 'https://vk.com/',
proxy: 'https://login:[email protected]:YYYY/',
method: 'POST',
headers: headers,
};
var headers = {
'User-Agent': 'Node js'
};
function callback(error, response, body) {
console.log(error);
if (response !== undefined)
console.log(response.statusCode);
}
req(options, callback);
{ [Error: tunneling socket could not be established, cause=write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794:] code: 'ECONNRESET' }
Answer the question
In order to leave comments, you need to log in
try changing options to the following. strictSSL false is added, and just http together with https is written in the proxy.
Also an additional question, are you making the request directly or are you on some sort of corporate network or behind a proxy server?
var options = {
url: 'https://vk.com',
proxy: 'http://login:[email protected]:YYYY',
method: 'POST',
headers: headers,
strictSSL: false
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question