Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure npm, git and bower for Visual Studio behind a proxy

How to configure properly Visual studio tools to work behind a proxy ?

like image 386
rdhainaut Avatar asked Dec 08 '16 11:12

rdhainaut


People also ask

How npm install behind corporate proxy?

Go to command prompt or terminal depending on your machine(tip: hit Win + R and type cmd). In the command prompt type the following command npm config set proxy http://<username><password>@proxy-server-url>:<port> then config set https-proxy http://<username><password>@proxy-server-url>:<port> .


1 Answers

To configure proxy settings for npm package manager

  1. Close Visual Studio.
  2. Open a Visual Studio developer command window (Go to Start menu -> In folder Visual Studio XXXX -> Developer Command Prompt)
  3. In the Visual Studio developer command window, type the following command: npm config set proxy http://proxyuser:[email protected]:8080.
  4. Then type this command: npm config set https-proxy http://proxyuser:[email protected]:8080.
  5. Open Visual Studio.

To configure proxy settings for git

  1. Close Visual Studio.
  2. Open a Visual Studio developer command window (Go to Start menu -> In folder Visual Studio XXXX -> Developer Command Prompt)
  3. In the Visual Studio developer command window, type the following command: git config --global http.proxy http://proxyuser:[email protected]:8080.
  4. Type this command:git config --global https.proxy http://proxyuser:[email protected]:8080.
  5. Open Visual Studio.

To configure proxy settings for bower

  1. Close Visual Studio.
  2. Navigate to the user directory (Type %UserProfile% in the explorer's path)
  3. Create the file .bowerrc (Type ".bowerrc." as file name)
  4. Write

    { 
      "registry": "http://bower.herokuapp.com", 
      "proxy": "http://proxyuser:[email protected]:8080", 
      "https-proxy": "http://proxyuser:[email protected]:8080"
    }
    
  5. Save the file
  6. Open Visual Studio.

WARNING: If you have specials characters in your proxy password, you must encode the proxy url. Example:

  • username: DOMAIN\user name
  • password: P@$$w0rd
  • proxy server: 10.80.0.0
  • proxy port: 8080
  • PROXY URL with authentification: http://DOMAIN%5Cuser+name%3AP%40%24%[email protected]:8080

Et Voilà :)

like image 63
rdhainaut Avatar answered Sep 30 '22 18:09

rdhainaut