Expand description
STUN client (RFC 5389) on a socket we own, plus NAT classification.
Two servers on different operators are queried so the answers can be
compared: the same ip:port from both means a cone NAT and a usable
reflexive candidate; the same IP with different ports means the mapping is
chosen per destination — symmetric — and the port STUN saw is not the port
the pilot would arrive on. Anycast within one provider could hide that,
which is why two operators rather than one.
Structs§
- NatDiscovery
- What STUN could work out about our position behind the NAT.
Enums§
Constants§
Functions§
- discover
- Query every STUN server from
sockand classify what we see. - discover_
with_ timeout - encode_
binding_ request - Encode a Binding Request with the given 12-byte transaction id.
- encode_
binding_ response - Build a Binding Success Response carrying
addr(test helper and useful for a future in-process STUN server). - parse_
binding_ response - Extract XOR-MAPPED-ADDRESS from a Binding Success Response for
txid.