I've read up on Bonjour and on the Network framework and it appears to me (and I may be wrong) that
these capabilities only support either devices on the same local network, or devices that are in close proximity to one another.
Correct.
This is a hard problem in general. As well as the things you’ve mentioned, you need to consider NAT.
Have a look at this to get started: https://en.wikipedia.org/wiki/STUN
The difficulty of true peer-to-peer communication on the Internet leads many to use a centralised server or some other alternative.
Topic:
App & System Services
SubTopic:
Networking
Tags: