MCPcopy
hub / github.com/hwholiday/learning_tools / main

Function main

istio/gateway/gateway.go:22–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22func main() {
23 mux := http.NewServeMux()
24 mux.HandleFunc("/connect", getConn)
25 mux.HandleFunc("/test", func(writer http.ResponseWriter, request *http.Request) {
26 _, _ = writer.Write([]byte("test gateway success"))
27 })
28 // HTTP服务
29 server := http.Server{
30 Addr: ":8888",
31 ReadTimeout: time.Duration(20) * time.Second,
32 WriteTimeout: time.Duration(20) * time.Second,
33 Handler: mux,
34 }
35 fmt.Println("启动WS服务器成功 :", 8888)
36 _ = server.ListenAndServe()
37}
38
39func getConn(res http.ResponseWriter, req *http.Request) {
40 var (

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.80

Tested by

no test coverage detected