mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 21:54:13 +08:00
Fix v2ray transport's client path
&& Update the docs
This commit is contained in:
parent
c16b017cd1
commit
4cc9ebb5e8
@ -55,7 +55,7 @@ The client will choose randomly and the server will verify if not empty.
|
||||
|
||||
Path of HTTP request.
|
||||
|
||||
The server will verify if not empty.
|
||||
`/` will be used if empty.
|
||||
|
||||
#### method
|
||||
|
||||
@ -103,7 +103,7 @@ Specifies the timeout duration after sending a PING frame, within which a respon
|
||||
|
||||
Path of HTTP request.
|
||||
|
||||
The server will verify if not empty.
|
||||
`/` will be used if empty.
|
||||
|
||||
#### headers
|
||||
|
||||
@ -203,7 +203,7 @@ The server will verify if not empty.
|
||||
|
||||
Path of HTTP request.
|
||||
|
||||
The server will verify if not empty.
|
||||
`/` will be used if empty.
|
||||
|
||||
#### headers
|
||||
|
||||
|
@ -54,7 +54,7 @@ V2Ray Transport 是 v2ray 发明的一组私有协议,并污染了其他协议
|
||||
|
||||
HTTP 请求路径
|
||||
|
||||
默认服务器将验证。
|
||||
默认 `/`。
|
||||
|
||||
#### method
|
||||
|
||||
@ -102,7 +102,7 @@ HTTP 请求的额外标头
|
||||
|
||||
HTTP 请求路径
|
||||
|
||||
默认服务器将验证。
|
||||
默认 `/`。
|
||||
|
||||
#### headers
|
||||
|
||||
@ -202,7 +202,7 @@ gRPC 服务名称。
|
||||
|
||||
HTTP 请求路径
|
||||
|
||||
默认服务器将验证。
|
||||
默认 `/`。
|
||||
|
||||
#### headers
|
||||
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
@ -77,6 +78,9 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
|
||||
} else {
|
||||
uri.Scheme = "https"
|
||||
}
|
||||
if !strings.Contains(options.Path, "/") {
|
||||
options.Path = "/" + options.Path
|
||||
}
|
||||
uri.Host = serverAddr.String()
|
||||
uri.Path = options.Path
|
||||
err := sHTTP.URLSetPath(&uri, options.Path)
|
||||
|
@ -50,6 +50,9 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
|
||||
} else {
|
||||
requestURL.Scheme = "https"
|
||||
}
|
||||
if !strings.Contains(options.Path, "/") {
|
||||
options.Path = "/" + options.Path
|
||||
}
|
||||
requestURL.Host = serverAddr.String()
|
||||
requestURL.Path = options.Path
|
||||
err := sHTTP.URLSetPath(&requestURL, options.Path)
|
||||
|
@ -46,6 +46,9 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
|
||||
} else {
|
||||
requestURL.Scheme = "wss"
|
||||
}
|
||||
if !strings.Contains(options.Path, "/") {
|
||||
options.Path = "/" + options.Path
|
||||
}
|
||||
requestURL.Host = serverAddr.String()
|
||||
requestURL.Path = options.Path
|
||||
err := sHTTP.URLSetPath(&requestURL, options.Path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user