I want to make P2P connection between two remote PC's
because I want to make it more easier I want to enable port forwarding to the router but only through my software not by the user.
and I heard that UPnP contain port forwarding.
and there is linux open source that implement it.
so I want to see if the open source working well with any kind of router or if its limited.
Bests
Tamar
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi agian Christoph.
I want to ask you also if there is any source code for port forwarding that implemted in c/c++ and not in java.
thank you very much for all the links
Tamar
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am sorry, but I don't have any experiences with C++. Platinum ( http://www.plutinosoft.com/blog/goodies/platinum ) seems to be a good UPnP library for C++, but you will have to implement the logic to create port mappings on your own.
You could also try http://miniupnp.free.fr/ as it seems to provide an interface for the internet gateway device.
HTH & Kind regards,
Christoph.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you want to enable your program to create port forwardings, you will need a library like UPNPLib ( http://www.sbbi.net/site/upnp/index.html ) which is used by PortMapper.
Getting Error while adding router to port mapping. Madem : DSL-2730U (Airtel). This error got in Windows 8.1.
Log :
1. When you click "Connect"
INFO Searching for routers...
INFO Connected to router DSL-2730U
INFO Got internal host name '192.168.1.1' for router.
INFO Got external IP address 122.171.158.156 for router.
INFO Found 0 mappings, 0 mappings returned as null.
INFO Found 0 mappings
When you click "Create" in PortMapping Presets
INFO Got internal host name '192.168.1.1' for router.
INFO Got internal host name '192.168.1.1' for router.
INFO Got internal host name '192.168.1.1' for router.
INFO Got internal host name '192.168.1.1' for router.
INFO Saved preset 'gg'.
When you click "Use" in PortMapping Presets
INFO Adding port mapping TCP :8085 -> 192.168.1.4:1 enabled gg
INFO 1 port mapping added successfully
INFO Found 0 mappings, 0 mappings returned as null.
INFO Found 0 mappings
When you click "Update"
INFO Found 0 mappings, 0 mappings returned as null.
INFO Found 0 mappings
Please help immediately. This required for my project.
Thank You.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
where in the code should i find port forwarding?
I tried to extract the PortMapper but I can't see the files
Best Regards
Tamar Badichi
Hi Christoph,
I want to make P2P connection between two remote PC's
because I want to make it more easier I want to enable port forwarding to the router but only through my software not by the user.
and I heard that UPnP contain port forwarding.
and there is linux open source that implement it.
so I want to see if the open source working well with any kind of router or if its limited.
Bests
Tamar
Hi Tamar,
ok, you will need a UPnP Library like that from http://www.sbbi.net/site/upnp/index.html (which is also used in PortMapper but is not supported any more) or that from http://upnp.fokus.fraunhofer.de/ (which is under active development, but more complex and harder to integrate).
As a quick start you could use the Router class of PortMapper ( http://upnp-portmapper.svn.sourceforge.net/viewvc/upnp-portmapper/tags/v1.5.0/src/org/chris/portmapper/router/Router.java?view=markup ) in your application. The class provides a method to connect to the router and to create port mappings:
Router router = Router.findRouter();
router.addPortMapping(description, protocol, remoteHost, externalPort, internalClient, internalPort, leaseDuration);
Kind regards,
Christoph.
Hi agian Christoph.
I want to ask you also if there is any source code for port forwarding that implemted in c/c++ and not in java.
thank you very much for all the links
Tamar
Hello Tamar,
I am sorry, but I don't have any experiences with C++. Platinum ( http://www.plutinosoft.com/blog/goodies/platinum ) seems to be a good UPnP library for C++, but you will have to implement the logic to create port mappings on your own.
You could also try http://miniupnp.free.fr/ as it seems to provide an interface for the internet gateway device.
HTH & Kind regards,
Christoph.
Hi Tamar,
What do you want to achieve?
If you want to enable your program to create port forwardings, you will need a library like UPNPLib ( http://www.sbbi.net/site/upnp/index.html ) which is used by PortMapper.
PortMapper is not distributed with source code, so you will have to look at the code in SVN ( https://sourceforge.net/svn/?group_id=213879 ) for examples. The logic that communicates with the router is encapsulated in class org.chris.portmapper.router.Router (see http://upnp-portmapper.svn.sourceforge.net/viewvc/upnp-portmapper/tags/v1.5.0/src/org/chris/portmapper/router/Router.java?view=markup ).
HTH,
Christoph.
Getting Error while adding router to port mapping. Madem : DSL-2730U (Airtel). This error got in Windows 8.1.
Log :
1. When you click "Connect"
INFO Searching for routers...
INFO Connected to router DSL-2730U
INFO Got internal host name '192.168.1.1' for router.
INFO Got external IP address 122.171.158.156 for router.
INFO Found 0 mappings, 0 mappings returned as null.
INFO Found 0 mappings
When you click "Create" in PortMapping Presets
INFO Got internal host name '192.168.1.1' for router.
INFO Got internal host name '192.168.1.1' for router.
INFO Got internal host name '192.168.1.1' for router.
INFO Got internal host name '192.168.1.1' for router.
INFO Saved preset 'gg'.
When you click "Use" in PortMapping Presets
INFO Adding port mapping TCP :8085 -> 192.168.1.4:1 enabled gg
INFO 1 port mapping added successfully
INFO Found 0 mappings, 0 mappings returned as null.
INFO Found 0 mappings
When you click "Update"
INFO Found 0 mappings, 0 mappings returned as null.
INFO Found 0 mappings
Please help immediately. This required for my project.
Thank You.