public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Michael Gronager <gronager@ceptacle•com>
To: Bitcoin Dev <bitcoin-development@lists•sourceforge.net>
Subject: [Bitcoin-development] NATPMP and proxy support in libcoin
Date: Wed, 29 Feb 2012 14:09:26 +0100	[thread overview]
Message-ID: <A0ED94EF-D9BE-4015-A8CB-30527CAA72EA@ceptacle.com> (raw)

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


                 reply	other threads:[~2012-02-29 13:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A0ED94EF-D9BE-4015-A8CB-30527CAA72EA@ceptacle.com \
    --to=gronager@ceptacle$(echo .)com \
    --cc=bitcoin-development@lists$(echo .)sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox