mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-11-06 08:15:35 +00:00
Every `serve` bound a random port, so a restart left each phone holding addresses that no longer answered. Where the n0 relays are unreachable, which is common behind the Great Firewall, the phone had no other way to find the gateway until it was paired again. - `serve` listens on the same UDP port every time. It picks one on first run, keeps it in `<config dir>/mobile/port`, and moves only if the port is taken. IPv6 binding may fail, as in iroh's own defaults. - Both ends add mDNS lookup (`iroh-mdns-address-lookup`, service `_tty7._udp`). On the same network a phone finds the gateway by key when its addresses are stale, such as after a new DHCP lease or a new IPv6 prefix. The gateway advertises and the phone only listens. If multicast is refused, each side starts without it and says so, rather than failing. - iOS: `Info.ios.plist` declares the local-network use and the Bonjour service, without which iOS blocks multicast. - An ignored test (`--test mdns`) connects by key alone over mDNS, for a machine that allows multicast.