func websocketDial(tt *tunneltest.TunnelTest, ident string) (*websocket.Conn, error) { req := tt.Request(ident, nil) if req == nil { return nil, fmt.Errorf("no client found for ident %q", ident) } h := http.Header{"Host": {req.Host}} wsurl := fmt.Sprintf("ws://%s", tt.ServerAddr()) conn, _, err := dialer.Dial(wsurl, h) return conn, err }