简体   繁体   English

从Node.js中的地址设置代理

[英]Setting up proxy from an address in nodejs

Suppose one is on a network address and these are the credentials: 假设一个在网络地址上,这些是凭据:

Address: 172.a.b.c
Port:8080
Password:abcd

Am trying to set up node js where one is required to set up proxy: 我正在尝试设置需要设置代理的节点js:

npm config set proxy http://user:password@url:port
npm config set https-proxy http://user:password@url:port

Can someone help me in how will i add my address and password to the 有人可以帮助我如何将我的地址和密码添加到

 npm config set....

I'm not 100% sure what you're asking? 我不确定您要问什么? You're are asking how you attach your user + password to the npm configuration right? 您在问如何将用户名和密码附加到npm配置上? If so, this should help you: 如果是这样,这应该对您有帮助:

npm config set proxy http://YOUR_USERNAME_HERE:YOUR_PASSWORD_HERE@url:YOUR_PORT_HERE

npm config set proxy-https http://YOUR_USERNAME_HERE:YOUR_PASSWORD_HERE@url:YOUR_PORT_HERE

It may end up looking like this 它可能最终看起来像这样

npm config set proxy http://james:jamesIsCool@url:3000

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

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