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

x/pkgsite: in cmd/frontend's --proxy_url argument, exclude localhost from https requirement #40123

Open
shsms opened this issue Jul 8, 2020 · 1 comment

Comments

@shsms
Copy link

@shsms shsms commented Jul 8, 2020

What did you do?

I tried to start pkgsite/cmd/frontend using this command line:

./frontend --direct_proxy --proxy_url http://localhost:3000

I want to use http://localhost:3000 with the --proxy_url argument, because I'm trying to create a small kubernetes deployment with the athens module proxy and pkgsite in the same pod.

What did you expect to see?

pkgsite/cmd/frontend starts without errors using http://localhost:3000 as the proxy url.

What did you see instead?

The below fatal error:

Error: proxy.New("http://localhost:3000"): scheme must be https (got http)

In https://github.com/golang/pkgsite/blob/master/internal/proxy/client.go#L53 if we exclude localhost from the https requirement, that would solve my immediate problem.

But later on, if we want to move athens and pkgsite into their own separate deployments, I'll have to point pkgsite to http://athens.develop:3000, and that won't work (we don't have https for communication within the cluster)

If we want to allow all such internal communications, another option would be to resolve the hostname, and if it is in a private IP address range, then don't expect https. But I'm not sure if that would have implications in other private IP situations.

@gopherbot gopherbot added this to the Unreleased milestone Jul 8, 2020
@dmitshur
Copy link
Member

@dmitshur dmitshur commented Jul 11, 2020

/cc @julieqiu per owners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.