public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [Bitcoin-development] NATPMP and proxy support in libcoin
@ 2012-02-29 13:09 Michael Gronager
  0 siblings, 0 replies; only message in thread
From: Michael Gronager @ 2012-02-29 13:09 UTC (permalink / raw)
  To: Bitcoin Dev

I just finished adding NATPMP, together with IDG UPnP, to libcoin. This enables libcoin/bitcoind to setup port mapping also on Apple routers (AirPort Extreme/Express/TimeMachine) and a few other that supports this protocol.

libcoin/bitcoind first tried to setup mapping using UPnP, if that fails it resorts to using PMP. 

It chooses a lease time of (default) 20 minutes and renews this every 10 minutes. This also means that if you are running libcoin on your laptop it will, when e.g. moved to your work, just setup the mapping there and the mapping back home will silently expire.

To include portmapping in libcoin/bitcoind the only thing needed is to add the PortMapper class and start it:

        PortMapper mapper(node.get_io_service(), port);
        if(portmap) mapper.start();

where "portmap" is the former "upnp" command line option.

Also note that I choose to include the relevant portions of miniupnpc and libnatpmp in the coinNAT library to make it easier to build.

I choose to make a rather aggressive setting for quitting searching for an IGD device (3 seconds). If I waited too long here the PMP port mapping would only kick in after the other clients had tried to connect to the new node and timed out.

If it is too small please notify me - I only have access to a UPnP router sporadicly. 

And btw: Also added proxy capability to libcoin (have a look in coinChain/Proxy.h for implementation details).

Cheers,

Michael


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-29 13:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-29 13:09 [Bitcoin-development] NATPMP and proxy support in libcoin Michael Gronager

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox