I have full-access to my router so I can forward all the ports I want, but I wanted to make something less tech-savvy people can use.
Without knowing specifics (and plenty has changed in the years/decades since this was my primary concern), one way of establishing a handshake is to use a 'guaranteed' port[1] that's already likely to be tunelled.
The network doesn't really care if the stream of data is using a datagram 'pretending' to be web-page traffic, but contains entirely proprietary game-data/etc. Some of the
monitoring and
traffic-shaping elements might (if a firewall doesn't like the 'gobbledygook 'pretending to be a web-request), or you're crossing a router that 'knows' to NAT web-traffic off into the web-server's rather particular subnet, or maybe it's blocked http and will now only ever accept https (:443?). But most end-users aren't hidden behind systems that don't have one or more 'allowed' sockets to more easily be connected.
Or you could even make it 'properly' formed (e.g. XML data as an actual HTTP(S) return from a suitable 'page request' to a suitable faux-webserver (or
actual webserver, with backend extensions).
There's all kinds of ways I might try this (or even have, but long ago, and may no longer work as well as they used to...), but time marches on. What might have gotten around the NAT of times past might not do so these days (and what didn't used to might well do so quite nicely). But torrenting and all kinds of other P2Ping became a big thing, over the intervening years, so whatever technomagery
they used must be a valid approach. And probably overkill. Probably all you need is some variation (if even required...) upon the DynamicDNS approach if you just want everyone to chat back and forth with
you. And you having carefully ensured that you're open enough (but proofed against spoofs), without needing your client endpoints to have paid any mind to their own router configs (and ISP policies) under most circumstances.
It all sounds intellectually interesting, though, and if I wasn't currently on the wrong end of a mobile connection right now, then I might even have poked and prodded at my own router (and a handy external server I can convince to engage in meaningful conversation) to check exactly what is problematically locked down and what is problematically far too open. (I've only minimally fiddled with it, previously, lazily accepting it as 'working', for most part, each time the ISP has deigned to deliver me a new modem/router for whatever reasons they gave at the time.)The (re)learning is half the fun, of course.
[1] Or a series of fallbacks... In the early days of the Web (
very early!), the access to ports less than... 512? ....or maybe 256/1024/whatever... were restricted use, inward and outward, so it was useful that port :80 for http could also be used for requests/server-listening by :8000 or :8080 (and others), at least until it became more than just a homebrewed thing and allowed just like FTP'S :20/:21, etc, but that would have been later. But you only rarely had to have odd numbers like ":1234" in your URI (when's the last time
you specified the port in your address-bar... I bet most people never realise it's an option.
) because it normally would try the several handshakes silently in the background.