node set proxy code example

Example 1: set proxy for npm

proxy=http://username:password@host:port
https-proxy=http://username:password@host:port
https_proxy=http://username:password@host:port

Example 2: how to proxy enable in server nodejs

proxy=http://username:password@host:port
https-proxy=http://username:password@host:port
https_proxy=http://username:password@host:port
no_proxy=127.0.0.1,localhost.*.mtn.co.za

Example 3: how to run node js with proxy

$ npm config set proxy http://localhost:3128
$ npm config set https-proxy http://localhost:3128