Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use Twisted with IPv6?

I'm trying to add IPv6 support to an application written with Twisted, which unfortunately does not support IPv6. There's a three-year-old ticket for this in Twisted's trac, but it seems to be stuck in debate with no indication of progress any time soon.

Ideally I'd like existing reactor methods like listenTCP and connectTCP to simply work, i.e. connectTCP would accept either IPv4 or IPv6 addresses and deal with the socket differences behind the scenes. The ticket does include a patch to do this, but it's rather old, and completely untested, so not really suitable for a production app, except as a reference point.

Before I spend a lot of time writing my own patch, I'm wondering whether anyone else has dealt with this, and if so, how.

like image 461
DNS Avatar asked Jun 02 '11 16:06

DNS


1 Answers

Yes. Use HostnameEndpoint to connect to a remote host regardless of its address family.

like image 118
Glyph Avatar answered Oct 29 '22 23:10

Glyph