简体   繁体   English

如何在代理后面配置node.js(express.js)应用程序?

[英]How to configure node.js (express.js) app behind proxy?

My node.js app (using express.js) needs to send https requests through my company's proxy. 我的node.js应用程序(使用express.js)需要通过我公司的代理发送https请求。

I tried the following commands to add the proxy but it doesn't work : 我尝试了以下命令来添加代理,但是它不起作用:

sudo npm config set proxy http://proxyIP:proxyPORT
sudo npm config set https-proxy https://proxyIP:proxyPORT

I'm still having a timeout : 我仍然有超时时间:

Error: connect ETIMEDOUT 194.3.8.11:443
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1081:14)

Any help please ? 有什么帮助吗? Many thanks 非常感谢

Problem Solved. 问题解决了。

I used the package global-tunnel PS : this package depends on tunnel package that you must update to version >=0.0.5 我使用了软件包global-tunnel PS:此软件包取决于您必须更新到版本> = 0.0.5的隧道软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM