-
Notifications
You must be signed in to change notification settings - Fork 270
Unable to use proxy authentication #572
Copy link
Copy link
Closed
Description
Current Behavior
I set auth-proxy address to npm proxy as following and I got invalid proxy error when I built some library.
- npm proxy setting
https-proxy=http://id:[email protected]:18080/
proxy=http://id:[email protected]:18080/
- error
node-pre-gyp WARN download ignoring invalid "proxy" config setting: "http://id:[email protected]:18080/"
Expected Behavior
The build process uses proxy config setting.
Additional Info
In the following code(L63), it looks like auth-proxy and 5 digits port is not taken into account.
I checked whether node-https-proxy-agent(L65) supports auth-proxy, and I guess it supports auth-proxy from this comment.
Lines 63 to 75 in f9b3948
| const m = proxyUrl.match(/^(?:(https?:)\/\/)?([^:]+)(?::(\d{1,4}))?\/?$/); | |
| if (m) { | |
| const ProxyAgent = require(m[1] === 'https:' ? 'https-proxy-agent' : 'http-proxy-agent'); | |
| const protocol = m[1] === 'https:' ? 'https:' : 'http:'; | |
| const host = m[2]; | |
| const port = +(m[3] || (protocol === 'https:' ? 443 : 80)); | |
| const agentOpts = { host, port, protocol }; | |
| agent = new ProxyAgent(agentOpts); | |
| log.http('download', 'proxy agent configured using: "%o"', agentOpts); | |
| } else { | |
| log.warn('download', 'ignoring invalid "proxy" config setting: "%s"', proxyUrl); | |
| } | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels