Compare commits

..
1 Commits
Author SHA1 Message Date
Fangliding a93737452e Print domain for lookup fail 2026-11-26 21:35:16 +08:00
2 changed files with 2 additions and 9 deletions
+2 -1
View File
@@ -255,10 +255,11 @@ func DialSystem(ctx context.Context, dest net.Destination, sockopt *SocketConfig
}
ips, err := LookupForIP(dest.Address.Domain(), finalStrategy, src)
if err != nil {
errors.LogErrorInner(ctx, err, "failed to resolve ip")
if sockopt.DomainStrategy.ForceIP() {
errors.LogErrorInner(ctx, err, "failed to resolve ip for: ", dest.Address.Domain())
return nil, err
}
errors.LogInfoInner(ctx, err, "failed to resolve ip for: ", dest.Address.Domain(), ", but continue due to USEIP* strategy")
} else if sockopt.HappyEyeballs == nil || sockopt.HappyEyeballs.TryDelayMs == 0 || sockopt.HappyEyeballs.MaxConcurrentTry == 0 || len(ips) < 2 || len(sockopt.DialerProxy) > 0 || dest.Network != net.Network_TCP {
dest.Address = net.IPAddress(ips[dice.Roll(len(ips))])
errors.LogInfo(ctx, "replace destination with "+dest.String())
-8
View File
@@ -130,14 +130,6 @@ func (c *UConn) WebsocketHandshakeContext(ctx context.Context) error {
config.NextProtos = []string{"http/1.1"}
return c.HandshakeContext(ctx)
}
// Chrome won't send ApplicationSettingsExtension for h1 request
if slices.Equal(ALPN, []string{"http/1.1"}) {
newExt := slices.DeleteFunc(c.Extensions, func(extension utls.TLSExtension) bool {
_, ok := extension.(*utls.ApplicationSettingsExtensionNew)
return ok
})
c.Extensions = newExt
}
// Iterate over extensions and check for utls.ALPNExtension
hasALPNExtension := false
for _, extension := range c.Extensions {