From 148ebccb60b0575811f1e4ba9dfee7e69a510aae Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Fri, 17 Mar 2023 16:35:34 +0800 Subject: [PATCH] Fix: ignore meanDelay error --- adapter/adapter.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adapter/adapter.go b/adapter/adapter.go index 094d9eb..db54bbe 100644 --- a/adapter/adapter.go +++ b/adapter/adapter.go @@ -161,7 +161,8 @@ func (p *Proxy) URLTest(ctx context.Context, url string) (delay, meanDelay uint1 resp, err = client.Do(req) if err != nil { - return + // ignore error because some server will hijack the connection and close immediately + return delay, 0, nil } resp.Body.Close() meanDelay = uint16(time.Since(start) / time.Millisecond / 2)