This commit is contained in:
liuxy 2025-12-18 12:21:03 +08:00 committed by GitHub
commit cc47f9fdf7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt"
"time" "time"
"github.com/metacubex/mihomo/common/callback" "github.com/metacubex/mihomo/common/callback"
@ -67,6 +68,11 @@ func (u *URLTest) DialContext(ctx context.Context, metadata *C.Metadata) (c C.Co
c.AppendToChains(u) c.AppendToChains(u)
} else { } else {
u.onDialFailed(proxy.Type(), err, u.healthCheck) u.onDialFailed(proxy.Type(), err, u.healthCheck)
expectedStatus, err := utils.NewUnsignedRanges[uint16](u.expectedStatus)
if err != nil {
return nil, fmt.Errorf("DialContext onDialFailed %s: %w", proxy.Name(), err)
}
proxy.URLTest(ctx, u.testUrl, expectedStatus)
} }
if N.NeedHandshake(c) { if N.NeedHandshake(c) {