Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy #1859

Closed
wants to merge 2 commits into from
Closed

Add proxy #1859

wants to merge 2 commits into from

Conversation

badeggg
Copy link

@badeggg badeggg commented Sep 25, 2020

I noticed that in version 7, proxy config does not take effect. So this pull
request make proxy config can work, and amend the relevant docs. Code changing
are tested (since I write a socks5/http proxy server by myself, so effect
can be checked easily).
Docs change for these reasons:

  • Express explicitly that socks proxy can be set and used. This is the original
    motivation of this pull request. A few weeks ago, I want use npm through socks5
    proxy, but the npm documentation does not mention that, and google searching
    results say that I need handle trans http request to socks proxy server
    in the outside of npm. Such as Running NPM install behind a socks5 proxy npm#6204 saying.
    After lots of source code reading and crunching, I find that npm ACTUALLY CAN be
    used behind socks proxy, but only docs does not say that (Notice that npm
    version 7 does not take any proxy effect which as I know is a beta version
    for now).
  • Environment variables HTTP_PROXY and PROXY do not effect for https request
    but only for http request(yes, I read make-fetch-happen source code ;-]).
    Since almost all real request is https rather than http, for the sake of
    simplicity, I delete 'http_proxy' description part.
  • Maybe I am wrong but I really don't know how to config 'an array' with
    npm config set noproxy 'an array of domain extensions'. So I amend that too.

References

Fixes npm/npm#6204

@badeggg badeggg requested a review from a team as a code owner September 25, 2020 07:32
@darcyclarke darcyclarke added Release 7.x work is associated with a specific npm 7 release beta labels Sep 25, 2020
isaacs pushed a commit that referenced this pull request Sep 30, 2020
PR-URL: #1859
Credit: @badeggg
Close: #1859
Reviewed-by: @isaacs

EDIT: changed flatOptions.noproxy to flatOptions.noProxy, since
make-fetch-happen reads it from the camel-cased property.
@isaacs isaacs mentioned this pull request Oct 1, 2020
@darcyclarke darcyclarke closed this Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants