Fix gRPC service name escape

This commit is contained in:
H1JK
2023-04-08 17:44:11 +08:00
committed by 世界
parent 7c563c2c07
commit fbef2eac5d
2 changed files with 5 additions and 7 deletions

View File

@@ -12,7 +12,6 @@ import (
"github.com/sagernet/sing-box/common/tls"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing-box/transport/v2rayhttp"
F "github.com/sagernet/sing/common/format"
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
@@ -48,9 +47,10 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
DisableCompression: true,
},
url: &url.URL{
Scheme: "https",
Host: serverAddr.String(),
Path: F.ToString("/", url.QueryEscape(options.ServiceName), "/Tun"),
Scheme: "https",
Host: serverAddr.String(),
Path: "/" + options.ServiceName + "/Tun",
RawPath: "/" + url.PathEscape(options.ServiceName) + "/Tun",
},
}