Closed liblaf closed 4 months ago
👏 Hi.
In my opinion, a trusted urltest endpoint should be trusted after the successful TLS handshake. There're too many reasons that may mess up the status code, such as some anti-bot rules of CDN. But for healthcheck (of sing-box), pingframe is enough, because we do not really care about the service status of the urltest endpoint, we only care about the (TLS) connection.
Sometimes we can connect to a website, but it will deny access, such as returning 403. We should check status code in URLTest.
This feature should only require a few minor changes to the code shown below.
https://github.com/SagerNet/sing-box/blob/bf612bef5f8b27ff4d5cc7cf984cc422754d1dc1/common/urltest/urltest.go#L103-L121
Should this request be accepted, I can help make a PR.