return
}
defer rwc.Close()
- location := "ws://" + req.Host + req.URL.Path
+ location := "ws://" + req.Host + req.URL.RawPath
// TODO(ukai): verify origin,location,protocol.
ws.Close()
}
+func TestWithQuery(t *testing.T) {
+ once.Do(startServer)
+
+ client, err := net.Dial("tcp", "", serverAddr)
+ if err != nil {
+ t.Fatal("dialing", err)
+ }
+
+ ws, err := newClient("/echo?q=v", "localhost", "http://localhost",
+ "ws://localhost/echo?q=v", "", client)
+ if err != nil {
+ t.Errorf("WebSocket handshake error", err)
+ return
+ }
+ ws.Close()
+}
+
func TestHTTP(t *testing.T) {
once.Do(startServer)