mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 21:54:13 +08:00
Support for host in header
This commit is contained in:
parent
86b00ea903
commit
483bad4791
@ -60,8 +60,13 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
|
||||
requestURL.Path = "/" + requestURL.Path
|
||||
}
|
||||
headers := make(http.Header)
|
||||
for key, value := range options.Headers {
|
||||
headers[key] = value
|
||||
for key, values := range options.Headers {
|
||||
for _, value := range values {
|
||||
headers.Add(key, value)
|
||||
}
|
||||
}
|
||||
if headersHost := headers.Get("host"); headersHost != "" {
|
||||
host = headersHost
|
||||
}
|
||||
return &Client{
|
||||
dialer: dialer,
|
||||
|
Loading…
x
Reference in New Issue
Block a user