Corporate proxy

I was using Cygwin and I had some trouble installing npm modules (for example, less) behind the proxy. In my IE, no proxy server has been set. How do I find my proxy server url? You can run the following command to find out:
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | find /i "proxyserver"
Then you can set up you npm:
npm config set proxy=127.0.0.1:8888
npm config set https-proxy=127.0.0.1:8888

Or you can just update your .npmrc file under /users/youraccount directly:
proxy=http://127.0.0.1:8888
https-proxy=http://127.0.0.1:8888

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Corporate proxy

  1. j5423's avatar j5423 says:

    Above solution stopped working and I have to use Fiddler to authenticate:
    1.Used Fiddler, with “Automatically Authenticate” selected
    2.In fiddler custom rules, I added:
    if (m_AutoAuth) {oSession["X-AutoAuth"] = "domain\\username:password";}
    3.Finally in npm i set the proxy as in the original post.

  2. j5423's avatar j5423 says:

    git has it's own proxy settings. You can use the following command to config:
    git config --global http.proxy "http://username:'password'@127.0.0.1:8888"

  3. j5423's avatar j5423 says:

    Today I found a great work-around for git proxy:
    git config --global url.https://github.com/.insteadOf git://github.com/

Leave a comment