mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-12-01 19:06:43 +00:00
Fix gRPC service name escape
This commit is contained in:
parent
e5f0add1ab
commit
5c1de2bb06
|
@ -13,7 +13,6 @@ import (
|
||||||
"github.com/sagernet/sing-box/option"
|
"github.com/sagernet/sing-box/option"
|
||||||
"github.com/sagernet/sing-box/transport/v2rayhttp"
|
"github.com/sagernet/sing-box/transport/v2rayhttp"
|
||||||
"github.com/sagernet/sing/common/bufio/deadline"
|
"github.com/sagernet/sing/common/bufio/deadline"
|
||||||
F "github.com/sagernet/sing/common/format"
|
|
||||||
M "github.com/sagernet/sing/common/metadata"
|
M "github.com/sagernet/sing/common/metadata"
|
||||||
N "github.com/sagernet/sing/common/network"
|
N "github.com/sagernet/sing/common/network"
|
||||||
|
|
||||||
|
@ -49,9 +48,10 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
|
||||||
DisableCompression: true,
|
DisableCompression: true,
|
||||||
},
|
},
|
||||||
url: &url.URL{
|
url: &url.URL{
|
||||||
Scheme: "https",
|
Scheme: "https",
|
||||||
Host: serverAddr.String(),
|
Host: serverAddr.String(),
|
||||||
Path: F.ToString("/", url.QueryEscape(options.ServiceName), "/Tun"),
|
Path: "/" + options.ServiceName + "/Tun",
|
||||||
|
RawPath: "/" + url.PathEscape(options.ServiceName) + "/Tun",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,8 @@ package v2raygrpclite
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -46,7 +44,7 @@ func NewServer(ctx context.Context, options option.V2RayGRPCOptions, tlsConfig t
|
||||||
server := &Server{
|
server := &Server{
|
||||||
tlsConfig: tlsConfig,
|
tlsConfig: tlsConfig,
|
||||||
handler: handler,
|
handler: handler,
|
||||||
path: fmt.Sprintf("/%s/Tun", url.QueryEscape(options.ServiceName)),
|
path: "/" + options.ServiceName + "/Tun",
|
||||||
h2Server: &http2.Server{
|
h2Server: &http2.Server{
|
||||||
IdleTimeout: time.Duration(options.IdleTimeout),
|
IdleTimeout: time.Duration(options.IdleTimeout),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue