Tub listens on *all* devices?

Brian Warner warner at lothar.com
Fri Apr 25 01:27:12 UTC 2014


On 4/19/14 8:23 PM, Roland Haeder wrote:

> I run Tahoe-LAFS on my laptops. Once I activate the WLAN chip, it
> is listens on it, too. Is there a way to force Tub not to listen on
> all (0.0.0.0) devices but only on specific?

Yup, just add a "interface=x.x.x.x" clause to your tub.port= setting:

 tub.port = tcp:8097:interface=1.2.3.4

The default is to listen on all interfaces. I'm pretty sure you have to
specify the IP address of the interface (rather than a name like "eth0"
or "lo"), which is a drag, but that's what the kernel API requires. I
don't *think* it's possible to listen on more-than-one but-not-all
interfaces this way, but I could be wrong.

"tub.port" is effectively parsed by Twisted's "serverFromString"
function, in case it helps, but the port number and the interface=
setting are really the only things that are useful to specify:

 http://twistedmatrix.com/documents/current/api/twisted.internet.endpoints.html#serverFromString

hope that helps,
 -Brian



More information about the tahoe-dev mailing list