Open router ports with miniupnp

You can open port of router with miniupnp like this:

sh=new Shell sh.Mode=0 ' is on windows but is easy to port Mac/Linux sh.Execute("upnpc-static.exe -a " +IP+ " " +InternalPort + " " +ExternarPort+ " " +Protocol) If sh.errorCode <> 0 then MsgBox "Print error: " + Str(sh.errorCode) end if sh.Close


IP: is internal IPv4 address
InternalPort: is port associated to internal IP
ExternarPort: is the external port
Protocol: is TCP or UDP

NOT ALL routers are working with miniupnp, and does not work if you have more than one router.

If you want add UPnP server support to your app, write declares for miniupnp libraries or i can write a rs/xojo plugin, anyone interested?

Thank you Bernardo,
This is a huge help!


Yes! I am interested very much. While the code sample worked in some limited cases, in most it does not. Need to be more completely finished. Whatever the name is not important (miniUPnP, Bonjour, whatever). Ideally even if the router does not have UPnP enabled or if there is more than one router in the LAN.

Anyone else?