Fix query escape

This commit is contained in:
H1JK 2022-08-26 19:06:14 +08:00 committed by Hellojack
parent e4973a90d9
commit 692bccd06f
4 changed files with 3 additions and 5 deletions

View File

@ -19,7 +19,6 @@ require (
require (
berty.tech/go-libtor v1.0.385 // indirect
ekyu.moe/leb128 v0.0.0-20190626180622-d3722dc409a8 // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/cretz/bine v0.2.0 // indirect

View File

@ -1,7 +1,5 @@
berty.tech/go-libtor v1.0.385 h1:RWK94C3hZj6Z2GdvePpHJLnWYobFr3bY/OdUJ5aoEXw=
berty.tech/go-libtor v1.0.385/go.mod h1:9swOOQVb+kmvuAlsgWUK/4c52pm69AdbJsxLzk+fJEw=
ekyu.moe/leb128 v0.0.0-20190626180622-d3722dc409a8 h1:zWcNapXDoFEobgJquW8jOgnVClkRLV9StPmi+LhtTGQ=
ekyu.moe/leb128 v0.0.0-20190626180622-d3722dc409a8/go.mod h1:hphPjsG3qJdFKRttMyBWptntD0vAUE3NUenOGL0914A=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY=

View File

@ -65,7 +65,7 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
url: &url.URL{
Scheme: "https",
Host: serverAddr.String(),
Path: fmt.Sprintf("/%s/Tun", options.ServiceName),
Path: fmt.Sprintf("/%s/Tun", url.QueryEscape(options.ServiceName)),
},
}
}

View File

@ -6,6 +6,7 @@ import (
"fmt"
"net"
"net/http"
"net/url"
"os"
"strings"
@ -42,7 +43,7 @@ func NewServer(ctx context.Context, options option.V2RayGRPCOptions, tlsConfig *
server := &Server{
handler: handler,
errorHandler: errorHandler,
path: fmt.Sprintf("/%s/Tun", options.ServiceName),
path: fmt.Sprintf("/%s/Tun", url.QueryEscape(options.ServiceName)),
tlsConfig: tlsConfig,
h2Server: &http2.Server{},
}