From a3ff32c22e6c8bfdf8bb3d6e66f8fa9eebbdd6f3 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 2 Jan 2017 12:30:24 -0800 Subject: [PATCH] core: implement bind host support Closes #379. --- classes.py | 4 ++++ example-conf.yml | 3 +++ 2 files changed, 7 insertions(+) diff --git a/classes.py b/classes.py index f0d1d45..cb58b6b 100644 --- a/classes.py +++ b/classes.py @@ -201,6 +201,10 @@ class Irc(): self.socket = socket.socket(stype) self.socket.setblocking(0) + # Set the socket bind if applicable. + if 'bindhost' in self.serverdata: + self.socket.bind((self.serverdata['bindhost'], 0)) + # Set the connection timeouts. Initial connection timeout is a # lot smaller than the timeout after we've connected; this is # intentional. diff --git a/example-conf.yml b/example-conf.yml index 292e808..7f82acb 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -88,6 +88,9 @@ servers: recvpass: "abcd" sendpass: "abcd" + # Set the bind host, useful for multi-homed hosts. + #bindhost: 1.2.3.4 + # The full network name, used by plugins. netname: "InspIRCd Network"