improvement(proxy): re-run NAT type check when network changes
See https://github.com/tladesignz/IPtProxy/issues/59
This is useful for iPtProxy (Orbot). Mobile devices might be switching from cellular to Wi-Fi and back, and they might have different NAT types. E.g. for me the NAT is unrestricted when I'm on cellular (see #40384 (comment 3086941))
My ideas on how to do this:
- Keep track of the set of our public IPs obtained with STUN and re-run the check if it changed.
- Somehow utilize
netstate
? Or other utilities that let us see changes to the network state.Package netstate implements utilities for retrieving and filtering network interface state.
There are routines to obtain the available set of of network addresess, for determining changes to those addresses
Edited by WofWca