| 118 | } |
| 119 | |
| 120 | func 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 | |
| 134 | func newConfig(t *testing.T, path string) *Config { |
| 135 | config, _ := NewConfig(fmt.Sprintf("ws://%s%s", serverAddr, path), "http://localhost") |