We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Something like this so we support both ipv6 and ipv4
func main() { finish := make(chan bool) mux := http.NewServeMux() mux.HandleFunc("/", handleRequest) go func() { log.Print(http.ListenAndServe("[127.0.0.1:8001](http://127.0.0.1:8001/)", mux)) }() go func() { log.Print(http.ListenAndServe("[::1]:8001", mux)) }() <-finish }
func handleRequest(w http.ResponseWriter, r *http.Request) { w.Write([]byte(fmt.Sprintf("Hello %s\n", r.RemoteAddr))) }
The text was updated successfully, but these errors were encountered:
Just using the port should support both ipv4 and ipv6 cases, right?
http.ListenAndServe(":8001")
Sorry, something went wrong.
No branches or pull requests
Something like this so we support both ipv6 and ipv4
The text was updated successfully, but these errors were encountered: