Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go1.8 linux/amd64
What operating system and processor architecture are you using (go env
)?
GOARCH="amd64" GOOS="linux"
What did you do?
I'm trying to serve godoc on a server that enforces https redirection
godoc -http=:60000
What did you expect to see?
When I browsed to https://<url>:60000
, I expected to see a working godoc landing page.
What did you see instead?
A page informing me of ERR_SSL_PROTOCOL_ERROR
"Unable to make a secure connection to the server"
Is there a way to serve godocs over https, using the godoc
utility?
Comment From: bradfitz
We do already have such support, but it's behind a build tag.
You can do:
$ go install --tags=autocert golang.org/x/tools/cmd/godoc
And then it'll listen on port 443 and use LetsEncrypt to get a cert.
We can use this bug to track making that more official.
Comment From: Happy-Ferret
Thanks.
Any way to `go get
´ this from Github? Golang.org is, for some reason, blocked at my company. Knowing the IT guys here, they'll have it unblocked just in time for Go 20.1...
Comment From: ianlancetaylor
I don't know whether go get
works, but you can clone it from the https://github.com/golang/tools repo.
Comment From: bradfitz
Pushing this to Go 1.10, by which time I hope we'll have our package management story more sorted out.
Comment From: bradfitz
(as my change above depends on golang.org/x/crypto/autocert)
Comment From: nehbit
Pinging this issue because there's an incompatibility between gopls
and godoc
that rests on godoc
being http-only.
For context, gopls
has a feature that allows you to set the documentation server. (gopls documentation). For private packages, we want this to point to localhost, hosted by godoc
.
However, gopls
is built in such a way that the link cannot be http
, it can only be https
. This means you cannot provide a localhost docs site provided by godoc
here.
It might be worth pushing this https
feature out to public so as to make sure godoc
is compatible with gopls
by default.
Let me know if you need more context. Thanks for all the hard work! Both godoc
and gopls
are invaluable tools.
Comment From: adonovan
gopls/v0.16.0, released today, contains an integrated documentation viewer, similar in style to pkg.go.dev, but that works on local unpublished packages and even unsaved editor buffers.
I'm going to close this issue, since godoc is deprecated.