Created
February 14, 2019 12:17
-
-
Save narqo/c87164fc29902378b3a0ae6d7b0731c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net" | |
"net/http" | |
) | |
const addr = ":8080" | |
func main() { | |
srv := &http.Server{/* ··· */} | |
ln, _ := net.Listen("tcp", addr) | |
log.Print("server is running on %s", addr) | |
// Note, net/http.ListenAndServe uses tcpKeepAliveListener | |
// see https://codereview.appspot.com/48300043/ for the backstory | |
srv.Serve(ln) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment