diff --git a/src/conf.py b/src/conf.py index d1fa9621b..2536f78c8 100644 --- a/src/conf.py +++ b/src/conf.py @@ -824,6 +824,10 @@ registerGlobalValue(supybot.protocols.irc, 'umodes', networks allow +x, which indicates to the auth services on those networks that you should be given a fake host.""")) +registerGlobalValue(supybot.protocols.irc, 'vhost', + registry.String('', """Determines what vhost the bot will bind to before + connecting to the IRC server.""")) + registerGlobalValue(supybot.protocols.irc, 'maxHistoryLength', registry.Integer(1000, """Determines how many old messages the bot will keep around in its history. Changing this variable will not take effect diff --git a/src/twistedDrivers.py b/src/twistedDrivers.py index 2aaa2a863..d1fb21daa 100644 --- a/src/twistedDrivers.py +++ b/src/twistedDrivers.py @@ -109,7 +109,8 @@ class SupyReconnectingFactory(ReconnectingClientFactory, drivers.ServersMixin): self.irc = irc drivers.ServersMixin.__init__(self, irc) (server, port) = self._getNextServer() - reactor.connectTCP(server, port, self) + vhost = conf.supybot.protocols.irc.vhost() + reactor.connectTCP(server, port, self, bindAddress=(vhost, 0)) def clientConnectionFailed(self, connector, r): drivers.log.connectError(self.currentServer, errorMsg(r))