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)))
}