# supplied nickname as their ident.
IDENT = "webchat"
+# OPTION: OUTGOING_IP
+# The IP address to bind to when connecting to the IRC server.
+#
+# This will not change the IP address that qwebirc listens on.
+# You will need to call run.py with the --ip/-i option if you
+# want that.
+#OUTGOING_IP = "127.0.0.1"
+
# OPTION: WEBIRC_MODE
# This option controls how the IP/hostname of the connecting
# browser will be sent to IRC.
def createIRC(*args, **kwargs):
f = QWebIRCFactory(*args, **kwargs)
+
+ tcpkwargs = {}
+ if hasattr(config, "OUTGOING_IP"):
+ tcpkwargs["bindAddress"] = (config.OUTGOING_IP, 0)
+
if CONNECTION_RESOLVER is None:
- reactor.connectTCP(config.IRCSERVER, config.IRCPORT, f)
+ reactor.connectTCP(config.IRCSERVER, config.IRCPORT, f, **tcpkwargs)
return f
def callback(result):
name, port = random.choice(sorted((str(x.payload.target), x.payload.port) for x in result[0]))
- reactor.connectTCP(name, port, f)
+ reactor.connectTCP(name, port, f, **tcpkwargs)
def errback(err):
f.clientConnectionFailed(None, err) # None?!