我需要通过Intranet代理将我的客户端HTTPS请求发送到服务器.我同时使用https和request + global-tunnel,两种解决方案似乎都不起作用.
与'http'类似的代码有效.我错过了其他设置吗?
代码失败并出现错误:REQUEST:请求问题:无法建立隧道套接字,因为socket挂起
HTTPS:events.js:72 throw er; //未处理的'错误'事件^错误:在CleadextStream.read [as_read]的EncryptedStream.CryptoStream._done(tls.js:703:22)的SecurePair.error(tls.js:1011:23)处挂断了套接字( tls.js:499:24)
代码是简单的https测试.
var http = require("https");
var options = {host:"proxy.myplace.com",port:912,path:" https://www.google.com ",headers:{Host:"www.google.com"}};
http.get(options,function(res){console.log(res); res.pipe(process.stdout);});