MCPcopy
hub / github.com/golang/net / startServer

Function startServer

websocket/websocket_test.go:120–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

118}
119
120func startServer() {
121 http.Handle("/echo", Handler(echoServer))
122 http.Handle("/count", Handler(countServer))
123 http.Handle("/ctrldata", Handler(ctrlAndDataServer))
124 subproto := Server{
125 Handshake: subProtocolHandshake,
126 Handler: Handler(subProtoServer),
127 }
128 http.Handle("/subproto", subproto)
129 server := httptest.NewServer(nil)
130 serverAddr = server.Listener.Addr().String()
131 log.Print("Test WebSocket server listening on ", serverAddr)
132}
133
134func newConfig(t *testing.T, path string) *Config {
135 config, _ := NewConfig(fmt.Sprintf("ws://%s%s", serverAddr, path), "http://localhost")

Callers

nothing calls this directly

Calls 4

HandlerFuncType · 0.70
StringMethod · 0.65
AddrMethod · 0.65
HandleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…