Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: GOPROXY should have an equivalent to NO_PROXY #29397

Closed
chowey opened this issue Dec 22, 2018 · 7 comments
Closed

cmd/go: GOPROXY should have an equivalent to NO_PROXY #29397

chowey opened this issue Dec 22, 2018 · 7 comments
Labels
FrozenDueToAge modules NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@chowey
Copy link

chowey commented Dec 22, 2018

What version of Go are you using (go version)?

$ go version
go version go1.11.1 windows/386

What did you do?

I have a GOPROXY set up that will fetch from upstream. This lets me work within an otherwise internal-only corporate LAN. My GOPROXY is a simplified version of the Athens Project. It works quite well for repos from github.com and the like.

However, I would like to include a private repo as a module. The private repo is on the internal LAN. It supports basic auth but is not publicly available. After importing my private repo, I try go get . which is equivalent to:

set GOPROXY=myproxy
go get private.repo.net/my/repo

Of course it fails authentication.

What did you expect to see?

There should be a mechanism to disable GOPROXY for certain URLs. For example, HTTP_PROXY has NO_PROXY. Maybe we can have a GO_NOPROXY that works the same way. Then I would expect go get . to work successfully for both public repos (through the proxy) and private repos (not through the proxy).

What did you see instead?

I saw failed authentication with no way to get around it.

I recognize that authentication is a complex subject, because the GOPROXY would have to forward the client credentials and cache the results on a per-user basis. My thought is that authenticated servers should probably be accessed directly and not through a GOPROXY; hence the need for a GO_NOPROXY environment variable.

@mvdan mvdan added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. modules labels Dec 23, 2018
@mvdan
Copy link
Member

mvdan commented Dec 23, 2018

/cc @bcmills @rsc

@hxzhao527
Copy link

This work is needed proxy to do, instead go get maybe.
The proxy handles auth or other custom request.

@clippit
Copy link

clippit commented Jan 10, 2019

There're possible ways:

  1. configuration about "no proxy url" in local, eg. "NO_PROXY"
  2. proxy server filters URLs and proxy to original site directly
  3. proxy server filters URLs and tell the client to get from original site

It seems by way 2 there can be no change with cmd/go, but it would break auth to original private repo. So I prefer way 1 or way 3.

@bcmills
Copy link
Contributor

bcmills commented Jan 10, 2019

Dup of #26334? Or is this in the opposite direction (you don't want to ask the proxy for that module even if it can supply it)?

CC @FiloSottile @marwan-at-work @hyangah

@bcmills bcmills added this to the Go1.13 milestone Jan 10, 2019
@marwan-at-work
Copy link
Contributor

I would expect go get . to work successfully for both public repos (through the proxy) and private repos (not through the proxy).

Sounds like a dup, as you'd be able to do GOPROXY=myproxy,direct

@chowey
Copy link
Author

chowey commented Jan 10, 2019

Yes, GOPROXY=myproxy,direct would do the trick. That seems to be the better solution.

@marwan-at-work
Copy link
Contributor

Closing this issue, feel free to discuss details in the original issue Brian mentioned above.

@golang golang locked and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

7 participants