diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-05-24 22:04:07 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-05-24 22:04:07 +0200 |
commit | b97e85feef6b4dad4add23d17e37fd5ee976e1e3 (patch) | |
tree | b586d22cd0947b937c02742dc6f4de283cb1db60 /fot.py | |
parent | 070ede1ae77a89728341f7d084e882e04ffd2d2a (diff) |
Added IPv6 support.
This currently needs the destination host to be stored in host6.
The local address can be bound by setting bind6.
Diffstat (limited to 'fot.py')
-rwxr-xr-x | fot.py | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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) |