1
私はgolangでキープアライブ接続を無効にしようとしているが、それを行う方法について明確な説明はありません。..Golang HTTPサーバを無効にするには、キープアライブ
package main
import (
"net/http"
"github.com/julienschmidt/httprouter"
"fmt"
)
func helloworld(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
fmt.Fprint(w, "Hello, World!")
}
func main() {
router := httprouter.New()
router.GET("/", helloworld)
fmt.Println("Running :-)")
http.Server.SetKeepAlivesEnabled(false)
log.Fatal(http.ListenAndServe(":3030", router))
}
誰もがこの問題を解決することができますか?
ありがとう:あなたは本当にそれを達成するために必要がある場合
は、独自のサーバーをインスタンス化します。これは、新しい人々のために理解するのがはるかに簡単だった。 – digiadit