Jigsaw-Code / outline-go-tun2socks

Apache License 2.0
227 stars 94 forks source link

fix: return failure faster on TCP unreachability #101

Closed bemasc closed 1 year ago

bemasc commented 1 year ago

This change avoids waiting for UDP checks if the TCP reachability check has already failed. For example, if the port is closed, the TCP connection should fail immediately, but the UDP checks might wait for the full timeout.

This change also updates the error type checking to modern Go style.