From b97e85feef6b4dad4add23d17e37fd5ee976e1e3 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Mon, 24 May 2010 22:04:07 +0200 Subject: Added IPv6 support. This currently needs the destination host to be stored in host6. The local address can be bound by setting bind6. --- fot.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'fot.py') diff --git a/fot.py b/fot.py index 8412e8c..75cdfaf 100755 --- a/fot.py +++ b/fot.py @@ -9,7 +9,7 @@ import os from ConfigParser import ConfigParser -import login +import login, ipv6 config = ConfigParser() @@ -130,9 +130,13 @@ for server in (server for server in config.sections() if server.startswith('serv ch = [x[0] for x in ms if c in x[1]] channels.append('%s (%s)' % (c, ' '.join(ch))) print '%s: %s' % (server, ' '.join(channels)) - del channels, ms, c, ch, x + #del channels, ms, c, ch, x factory = BotFactory(server, config.get(server, 'nickname')) - reactor.connectTCP(config.get(server, 'host'), config.getint(server, 'port'), factory) + if config.has_option(server, 'host6'): + bind6 = (config.get(server, 'bind6'), 0) if config.has_option(server, 'bind6') else None + ipv6.connectTCP6(config.get(server, 'host6'), config.getint(server, 'port6'), factory, bindAddress = bind6) + else: + reactor.connectTCP(config.get(server, 'host'), config.getint(server, 'port'), factory) loginfactory = login.getManholeFactory(globals(), os.path.expanduser('~/.fot.users')) reactor.listenTCP(3333, loginfactory) -- cgit v1.2.3