I'm looking for a solution to load dependencies for go behind a proxy. My setup is the following.
- I'm running Windows and mainly work with git bash to interact with for example the go command
- I have px proxy setup and running (it works just fine for other tools like pip)
- All my proxy env vars (http_proxy, https_proxy, HTTP_PROXY, HTTPS_PROXY) are set to http://127.0.0.1:1234 (the px proxy).
I try to run go get github.com/eclipse/paho.mqtt.golang
or go run bar/my_script.go
, but it always returns one of the following messages.
go: github.com/eclipse/paho.mqtt.golang@v1.3.4: reading https://proxy.golang.org/github.com/eclipse/paho.mqtt.golang/@v/v1.3.4.mod: 403 Forbidden
go: finding module for package github.com/eclipse/paho.mqtt.golang
xyz.com/foo/bar imports
github.com/eclipse/paho.mqtt.golang: module github.com/eclipse/paho.mqtt.golang: Get "https://proxy.golang.org/github.com/eclipse/paho.mqtt.golang/@v/list": Proxy Authentication Required
I already followed the advice from this question: How do I configure go command to use a proxy?. It didn't help.
Also, I tried GOPROXY=direct go get -v github.com/eclipse/paho.mqtt.golang
. Still the same output.
I would appreciate any tip.