Browser Dialer: Fix WSS with no early data

Fixes https://github.com/2dust/v2rayNG/issues/5519#issuecomment-4357741914
This commit is contained in:
RPRX
2026-05-02 21:55:12 +00:00
committed by GitHub
parent e61eeae258
commit b279076ba1

View File

@@ -75,7 +75,7 @@ func Reload() {
} }
} }
} else { } else {
w.Header().Set("Access-Control-Allow-Origin", "*"); w.Header().Set("Access-Control-Allow-Origin", "*")
w.Write(webpage) w.Write(webpage)
} }
}), }),
@@ -99,11 +99,9 @@ func DialWS(uri string, ed []byte) (*websocket.Conn, error) {
StreamResponse: true, StreamResponse: true,
} }
if ed != nil {
task.Extra = webSocketExtra{ task.Extra = webSocketExtra{
Protocol: base64.RawURLEncoding.EncodeToString(ed), Protocol: base64.RawURLEncoding.EncodeToString(ed),
} }
}
return dialTask(task) return dialTask(task)
} }
@@ -222,4 +220,3 @@ func CheckOK(conn *websocket.Conn) error {
func init() { func init() {
Reload() Reload()
} }