Skip to content

Commit

Permalink
WebSocket Early Data Protocol Harmonization with V2Ray/V2Fly (#548)
Browse files Browse the repository at this point in the history
* protocol harmonization with V2Ray/V2Fly by supporting both V2Ray server and XRay server

* protocol harmonization with V2Ray/V2Fly by supporting both V2Ray server and XRay server comment
  • Loading branch information
xiaokangwang authored and nekohasekai committed Oct 22, 2021
1 parent f391c76 commit 0888296
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion transport/internet/websocket/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0888296

Please sign in to comment.