parser: Fix nil match panic in v2rayTransportWsPath

This commit is contained in:
Shtorm
2026-09-19 14:13:33 +03:00
parent 2c379103f3
commit e63f3b6be2
+4
View File
@@ -27,6 +27,10 @@ func shadowsocksPluginOptions(plugin string) string {
func v2rayTransportWsPath(WebsocketOptions *option.V2RayWebsocketOptions, path string) {
reg := regexp.MustCompile(`^(.*?)(?:\?ed=(\d*))?$`)
result := reg.FindStringSubmatch(path)
if result == nil {
WebsocketOptions.Path = path
return
}
WebsocketOptions.Path = result[1]
if result[2] != "" {
WebsocketOptions.EarlyDataHeaderName = "Sec-WebSocket-Protocol"