-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
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.