projects
/
KiwiIRC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
760fa05
)
Multiple outgoing interface addresses
author
Darren
<darren@darrenwhitlen.com>
Sat, 3 Aug 2013 21:13:04 +0000
(22:13 +0100)
committer
Darren
<darren@darrenwhitlen.com>
Sat, 3 Aug 2013 21:13:04 +0000
(22:13 +0100)
server/irc/connection.js
patch
|
blob
|
blame
|
history
diff --git
a/server/irc/connection.js
b/server/irc/connection.js
index 37aa13433ac107a2725c2e67d15e07628fc575a3..5cb8dc8d6898ce2d6a46e9e3a2aa7e9648058dc3 100644
(file)
--- a/
server/irc/connection.js
+++ b/
server/irc/connection.js
@@
-168,6
+168,15
@@
IrcConnection.prototype.connect = function () {
host = dest_addr;
}
+ // If we have an array of interfaces, select a random one
+ if (typeof outgoing !== 'string' && outgoing.length) {
+ outgoing = outgoing[Math.floor(Math.random() * outgoing.length)];
+ }
+
+ // Make sure we have a valid interface address
+ if (typeof outgoing !== 'string')
+ outgoing = '0.0.0.0';
+
} else {
// No config was found so use the default
outgoing = '0.0.0.0';