mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-14 10:00:34 +00:00
Browser Dialer: Potential optimized IP and non-standard port
Fixes https://github.com/2dust/v2rayNG/issues/5519#issuecomment-4335112057
This commit is contained in:
@@ -373,6 +373,12 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
||||
if requestURL.Host == "" {
|
||||
requestURL.Host = dest.Address.String()
|
||||
}
|
||||
if browser_dialer.HasBrowserDialer() && realityConfig == nil {
|
||||
// For Browser Dialer's optimized IP and non-standard port
|
||||
if !(requestURL.Scheme == "http" && dest.Port == 80) && !(requestURL.Scheme == "https" && dest.Port == 443) {
|
||||
requestURL.Host += ":" + dest.Port.String()
|
||||
}
|
||||
}
|
||||
|
||||
requestURL.Path = transportConfiguration.GetNormalizedPath()
|
||||
requestURL.RawQuery = transportConfiguration.GetNormalizedQuery()
|
||||
@@ -434,6 +440,12 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
||||
if requestURL2.Host == "" {
|
||||
requestURL2.Host = dest2.Address.String()
|
||||
}
|
||||
if browser_dialer.HasBrowserDialer() && realityConfig2 == nil {
|
||||
// For Browser Dialer's optimized IP and non-standard port
|
||||
if !(requestURL2.Scheme == "http" && dest2.Port == 80) && !(requestURL2.Scheme == "https" && dest2.Port == 443) {
|
||||
requestURL2.Host += ":" + dest2.Port.String()
|
||||
}
|
||||
}
|
||||
requestURL2.Path = config2.GetNormalizedPath()
|
||||
requestURL2.RawQuery = config2.GetNormalizedQuery()
|
||||
httpClient2, xmuxClient2 = getHTTPClient(ctx, dest2, memory2)
|
||||
|
||||
Reference in New Issue
Block a user