mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-25 10:01:30 +00:00
Fix grpc request
This commit is contained in:
parent
6ce4e31fc8
commit
e8dad1afeb
|
@ -34,6 +34,7 @@ type Client struct {
|
|||
transport *http2.Transport
|
||||
options option.V2RayGRPCOptions
|
||||
url *url.URL
|
||||
host string
|
||||
}
|
||||
|
||||
func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, options option.V2RayGRPCOptions, tlsConfig tls.Config) adapter.V2RayClientTransport {
|
||||
|
@ -55,10 +56,11 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
|
|||
},
|
||||
url: &url.URL{
|
||||
Scheme: "https",
|
||||
Host: host,
|
||||
Host: serverAddr.String(),
|
||||
Path: "/" + options.ServiceName + "/Tun",
|
||||
RawPath: "/" + url.PathEscape(options.ServiceName) + "/Tun",
|
||||
},
|
||||
host: host,
|
||||
}
|
||||
|
||||
if tlsConfig == nil {
|
||||
|
@ -88,6 +90,7 @@ func (c *Client) DialContext(ctx context.Context) (net.Conn, error) {
|
|||
Body: pipeInReader,
|
||||
URL: c.url,
|
||||
Header: defaultClientHeader,
|
||||
Host: c.host,
|
||||
}
|
||||
request = request.WithContext(ctx)
|
||||
conn := newLateGunConn(pipeInWriter)
|
||||
|
|
Loading…
Reference in a new issue