Setting up corporatre network proxy (with username and password)

I am trying to set proxy settings for Julia to use, but without much success (I am behind corporate firewall).

System: Windows 10, Julia 1.10

The proxy is set in the form http://<User>@<Password>@<Addresss>:<Port> (this form works with pip install <...> --proxy=...)

I have tried setting it with

ENV["HTTP_PROXY"] = "..."

but it doesn’t work: I tried st for package status, it still cannot connect

(@v1.10) pkg> st
  Installing known registries into `C:\Users\Cherkaeva\.julia`
┌ Warning: could not download https://pkg.julialang.org/registries
│   exception = RequestError: Failed to connect to pkg.julialang.org port 443 after 21067 ms: Couldn't connect to server while requesting https://pkg.julialang.org/registries
└ @ Pkg.Registry C:\Users\Cherkaeva\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Registry\Registry.jl:69

Is my approach correct? Is there a walkaround?

1 Like

After some trial-and-error these are two changes I made to make it work:

  1. Julia doesn’t accept the syntax where user name and password are separated by @ in the proxy setting. It accepts colon. So, it should be http://<user>:<password>@<ip>:<port>

  2. I needed to set not only HTTP_PROXY but also HTTPS_PROXY. In my case both settings were the same.

1 Like