mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-27 14:43:00 +03:00
Parse X-Forward-For in HTTP requests
This commit is contained in:
@@ -21,11 +21,14 @@ type TLSDialer struct {
|
||||
}
|
||||
|
||||
func TLSConfig(serverAddress string, options option.OutboundTLSOptions) (*tls.Config, error) {
|
||||
if !options.Enabled {
|
||||
return nil, nil
|
||||
}
|
||||
var serverName string
|
||||
if options.ServerName != "" {
|
||||
serverName = options.ServerName
|
||||
} else if serverAddress != "" {
|
||||
if _, err := netip.ParseAddr(serverName); err != nil {
|
||||
if _, err := netip.ParseAddr(serverName); err == nil {
|
||||
serverName = serverAddress
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user