Proxy (Windows)

Environment variables

no_proxy=localhost,127.0.0.0/8,*.intranet.ib

http_proxy=http://%IPV4_ADDRESS%:3128/

https_proxy=http://%IPV4_ADDRESS%:3128/


where IPV4_ADDRESS is this workstation ip address:

IPV4_ADDRESS=172.23.200.238


For testing that the environment variables have been properly set, run:

curl http://icanhazip.com

curl https://icanhazip.com


Particular case for maven wrapper (proxy)

Maven Wrapper does not use the regular Maven setting.xml configuration file.

It honors the JAVA_TOOL_OPTIONS environment variable where the JVM proxy configuration should be set (look for 'JAVA_TOOL_OPTIONS' in this site for further details and examples).


Particular case for npm (proxy)

+(option 1) environment variable

set npm_config_proxy=%http_proxy%


+(option 2.a) without credentials (sample):

npm config set proxy http://%IPV4_ADDRESS%:3128/

[for unsetting] npm config rm proxy


+(option 2.b) with credentials (sample):

npm config set proxy http://DOMAIN%5CUSERNAME:PASSWORD@corpproxy.intranet.ib:8080/

[for unsetting] npm config rm https-proxy


Notes:

  • Change 'DOMAIN' by the corporate Windows domain
  • Change 'USERNAME' by the domain username
  • Cambiar 'PASSWORD' by the password (careful with special characters, might be in some cases necessary escape them or put them between quotes)



Px local proxy

An HTTP proxy server to automatically authenticate through an NTLM proxy.

Home site > https://github.com/genotrance/px


Installation and configuration (tested on Windows 10 behind a corporate proxy)

It does not require installation, just keep it in a directory, eg:

  • J:\SoFT\proxy\
  • px.exe
  • px.ini


[A] Configuration file "px.ini":

Remark: It does not require configuring credentials, as it picks up the current logged in user for authenticating into the configured corporate proxy (tested successfully on Windows 10).


The "px.ini" file is initially created using:

px --proxy=cpproxy04.intranet.corporation:8080 --save


It can be further edited with additional configuration:

  • 'hostonly' allows local apps as well as VM or container apps to use Px when in NAT config
[proxy]
server = cpproxy04.intranet.corporation:8080
pac = 
port = 3128
listen = 172.23.200.238
allow = *.*.*.*
gateway = 0
hostonly = 1
noproxy = 192.168.233.60, 192.168.139.28, 192.168.233.73
useragent = 
username = 
auth = 

[settings]
workers = 2
threads = 5
idle = 30
socktimeout = 20.0
proxyreload = 60
foreground = 0
log = 0


[B] Automatic start:

One time configuration that will execute automatically at start-up:

px --install

(for uninstalling) px --uninstall


[C] Manual start

px

(for quitting) px --quit




Troubleshooting (Px)

[1] Test connection through the local proxy (returns your IP address)

It returns your IP address. It can be executed, eg, from a 'Git Bash' console:

curl --proxy 127.0.0.1:3128 http://icanhazip.com


[2] [WinError 10013] Intento de acceso a un socket no permitido por sus permisos de acceso

The configured 'port' is probably already used by another program, eg: cntlm