diff --git a/transport/internet/websocket/dialer.go b/transport/internet/websocket/dialer.go index 67f159b1..6a06a67e 100644 --- a/transport/internet/websocket/dialer.go +++ b/transport/internet/websocket/dialer.go @@ -120,7 +120,8 @@ func dialWebSocket(ctx context.Context, dest net.Destination, streamSettings *in header := wsSettings.GetRequestHeader() if ed != nil { - header.Set("Sec-WebSocket-Protocol", base64.StdEncoding.EncodeToString(ed)) + // RawURLEncoding is support by both V2Ray/V2Fly and XRay. + header.Set("Sec-WebSocket-Protocol", base64.RawURLEncoding.EncodeToString(ed)) } conn, resp, err := dialer.Dial(uri, header)