Godoc -http localhost connection refused

I am trying to get godoc -http to work but o cannot get the browser to connect to localhost. Having trouble finding posts from anyone with a similar issue, What can i try to troubleshoot this?

Thanks!

godoc -http:=6060

using GOPATH mode

http://localhost:6060/

serves up:

This site can’t be reached

localhost refused to connect.

Try:

ERR_CONNECTION_REFUSED

godoc -http=:6060

It could be your firewall, maybe try running on another port or check your firewall program’s config to see if you can unblock it?

What output do you get when you run godoc?

Pay attention to the position of ‘=’ in -http:=6060, godoc cmd use flag lib parses the parameters.

1 Like

godoc -http=:6060

I think it was my environment i could not even serve up a simple web page, i re installed and did not change goroot and also had the go folder in the default location and everything worked.

I am using WSL. not sure why it did not install to the default in the first place, but [the third time] it worked and the go folder was where it should be. Everything worked including godoc. A bit of a mystery to me. Thanks to all for the responses. Not sure what i got wrong initially.

watch carefully:

godoc -http:=6060

godoc -http=:6060

This started happening again and i may have tracked it to a race condition that takes place between Windows Fast Boot and WSL a restart fixes it sometimes. The real cool thing when it happens is that if you check the status of localhost with a goroutine it has a status of 200 with no errors. its just the browser that will not connect; even with windows firewall off.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.