Skip to content

feat(client): try restricted proxy if NAT unknown

Just once, to offload unrestricted proxies. This is useful when our STUN servers are blocked or don't support the NAT discovery feature, or if they're just slow.

Closes #40178 (closed). Partially addresses #40376 (closed)

This, however, will mess up metrics because the client reports "unrestricted" NAT for the first attempt, and, as far as I know, NAT type for the client's IP will not be overridden on further requests for proxy.

This, however, will mess up metric counts a bit because the client reports "unrestricted" NAT for the first attempt. We count rendezvous requests in UpdateRendezvousStats.

I tested this change a bit. It appears to work. Update: and the new approach as well.

I did not add tests, unfortunately. Update: added. Update: with the new approach, the logic now is in the connect method, which is not easy to unit-test.

TODO:

  • Please check if we need to use a lock to update the new broker's property.
  • Is it worth to merge this in its current state and mess up the metrics? Or will they even get messed up? Where are they even? Not on the broker apparently. Resolution: it's fine !392 (comment 3074071)
  • Pipelines are failing. Seems to be an unrelated reason again?
Edited by WofWca

Merge request reports

Loading