Created
July 13, 2013 22:52
-
-
Save prawnsalad/5992512 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getConnectionFamily(this.socks.host, function (err, family, host) { | |
var outgoing; | |
if ((family === 'IPv6') && (global.config.outgoing_address.IPv6) && (global.config.outgoing_address.IPv6 !== '')) { | |
outgoing = global.config.outgoing_address.IPv6; | |
} else { | |
outgoing = global.config.outgoing_address.IPv4; | |
} | |
if (this.socks) { | |
that.socket = Socks.connect({ | |
host: that.irc_host.hostname, | |
port: that.irc_host.port, | |
ssl: that.ssl, | |
rejectUnauthorized: global.config.reject_unauthorised_certificates | |
}, {host: host, | |
port: that.socks.port, | |
user: that.socks.user, | |
pass: that.socks.pass, | |
localAddress: outgoing | |
}); | |
} else { | |
if (that.ssl) { | |
that.socket = tls.connect({ | |
host: host, | |
port: that.irc_host.port, | |
rejectUnauthorized: global.config.reject_unauthorised_certificates, | |
localAddress: outgoing | |
}); | |
socket_connect_event_name = 'secureConnect'; | |
} else { | |
that.socket = net.connect({ | |
host: host, | |
port: that.irc_host.port, | |
localAddress: outgoing | |
}); | |
} | |
} | |
addSocketHandlers.call(that);§ | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment