let connectTimeOut = setTimeout(function () { req.abort(); }, 10*1000);
let req = http.request({
hostname: reqUrl.hostname,
path: reqUrl.path,
method: req.method,
headers: headers,
}, function (res) {
clearTimeout(connectTimeOut);
...
});
经常连接不上直到 10 秒超时,网络都是正常的, wget 也能正常连接 reqUrl ,这是什么问题?
第 1 条附言 · 2017 年 2 月 15 日
我发现把程序放 docker 里面就很慢,直接在外面运行则没问题……很奇怪
4 条回复 • 2017-02-15 00:01:42 +08:00
|
1
linbiaye 2017 年 1 月 26 日
查你 header 不让你连。
|
|
3
erictaoy 2017 年 2 月 6 日
把 http.request 参数打印出来看看
|