add some useful options to example server (commented out)

This commit is contained in:
Lucas Clemente
2016-05-20 13:09:44 +02:00
parent 52d734f644
commit d77120a921

View File

@@ -20,6 +20,8 @@ func main() {
go func() { go func() {
log.Println(http.ListenAndServe("localhost:6060", nil)) log.Println(http.ListenAndServe("localhost:6060", nil))
}() }()
// runtime.SetBlockProfileRate(1)
verbose := flag.Bool("v", false, "verbose") verbose := flag.Bool("v", false, "verbose")
bindTo := flag.String("bind", "localhost", "bind to") bindTo := flag.String("bind", "localhost", "bind to")
certPath := flag.String("certpath", "", "certificate directory") certPath := flag.String("certpath", "", "certificate directory")
@@ -57,6 +59,8 @@ func main() {
panic(err) panic(err)
} }
// server.CloseAfterFirstRequest = true
err = server.ListenAndServe(*bindTo+":6121", nil) err = server.ListenAndServe(*bindTo+":6121", nil)
if err != nil { if err != nil {
panic(err) panic(err)