Jigsaw-Code / outline-go-tun2socks

Apache License 2.0
231 stars 94 forks source link

fix: adjust connectivity check heuristics #100

Closed bemasc closed 1 year ago

bemasc commented 1 year ago

This change adjusts the connectivity check to fix two issues reported by users:

  1. On low-quality networks, the test sometimes fails even though the server is reachable. This is addressed by lengthening the timeouts.
  2. On networks that are blocking TCP access to the server, the test will succeed if UDP access is working, even though the server is effectively unusable.

This change has the negative effect of slowing down the connectivity check for all users. If the server is working, the user must wait longer because both the UDP and TCP tests must complete, and the TCP test is slower than the UDP test. If the server is unreachable, the test will wait for twice as long (10 seconds) before failing.