Node.js使用代理的HTTP代理

3
var HttpsProxyAgent = require('https-proxy-agent');
this.agent = new HttpsProxyAgent("http://example.proxy.com");

然而,我还需要添加一个设置node.js原始代理的设置。

http.Agent({ keepAlive: true });

我没有看到httpsproxyagent中设置此选项的选项,因为https-proxy-agent派生自 agent-base 。 有没有一种使用不同的node.js模块来实现这个目标的方法?

1个回答

0
我使用了hpagent模块。 它默认开启keepAlive: true
https-proxy-agent则有a PR来添加这个功能。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接