https://github.com/rj/libportfwd
Set up port fwds and find external IP: C++/CMake wrapper for miniupnpc and nat-pmp libs
https://github.com/rj/libportfwd
Last synced: 15 days ago
JSON representation
Set up port fwds and find external IP: C++/CMake wrapper for miniupnpc and nat-pmp libs
- Host: GitHub
- URL: https://github.com/rj/libportfwd
- Owner: RJ
- Created: 2009-07-08T16:37:14.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2011-09-09T10:55:39.000Z (over 13 years ago)
- Last Synced: 2025-05-06T22:56:47.650Z (15 days ago)
- Language: C
- Homepage:
- Size: 382 KB
- Stars: 14
- Watchers: 6
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
libportfwd
----------
A basic, lightweight c++ wrapper around miniupnp and nat-pmp libraries
for setting up port fwds, detecting max up/downstream bandwidth, and
finding out external IP address.See: http://miniupnp.free.fr/
Designed to wrap up miniupnpc+natpmp libs into a static lib with a small API
so other projects can easily setup port fwds without shipping extra libs/deps.Should detect any upnp or nat-pmp router and automatically use the appropriate
library under the hood.Uses cmake to build needed bits of miniupnpc..
NB/TODO
-------
I don't have a nat-pmp capable device (eg: airport express)
so haven't implemented that bit yet. only supports upnp atm.Usage
-----
See the demo in main.cpp, but here's the jist:Portfwd pf;
pf.init(2000); // 2000 = ms to wait for response from router
pf.add(1234); // port to fwd to you
pf.remove(1234); // remove port fwding on exit