views:

742

answers:

2

I'd like to make it easy for users to forward a port on their NAT to their local machine for my C++ app. I'd like to make this work on OSX & Windows. Linux would be a great bonus, but Linux users are probably more comfortable forwarding ports manually, so it is less of a concern. LGPL type code is OK, but I can't use anything that is straight GPL.

I'd love to hear any thoughts or experiences anyone has had in this area, but a few specific questions come to mind:

  • Is there a recognized best library for UPNP? The MiniUPNP client looks like it might work, but is there anything else out there?
  • What about Bonjour? Can I rely on it for OSX computers?
  • All the big bittorrent apps have to deal with this, so is there an existing survey of how they do it? What about Skype?
+2  A: 

MiniUPNP is used by at least one bittorrent client (Transmission) and should work fine.

A: 

Bonjour on both OS X and Windows can be used to do port mappings with routers that support uPNP or NAT-PMP. I haven't used the API (DNSServiceNATPortMappingCreate) but I have successfully published wide-area services on both Windows and OS X behind a NAT-PMP router. I'm not sure if your Windows users will want to install Bonjour (although they may already have it if they use iTunes or Safari) to use your app but on OS X support shouldn't be an issue.

andrewtj