diff --git a/lib/irc.js b/lib/irc.js index 23ccfe08..a62647c0 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -40,6 +40,7 @@ function Client(server, nick, opt) { realName: 'nodeJS IRC client', port: 6667, localAddress: null, + existingSocket: null, debug: false, showErrors: false, autoRejoin: false, @@ -792,6 +793,11 @@ Client.prototype.connect = function(retryCount, callback) { util.log(self.conn.authorizationError); } }); + } else if (self.opt.existingSocket) { + // must be an already connected socket, e.g. from socks proxy + self.conn = self.opt.existingSocket; + // call connection handler asynchronously, emulating connection success + setTimeout(self._connectionHandler.bind(self), 0); } else { self.conn = net.createConnection(connectionOpts, self._connectionHandler.bind(self)); } diff --git a/package.json b/package.json index f70dcdbe..7d93d4e7 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "Chris Nehren ", "Henri Niemeläinen ", "Alex Miles ", - "Simmo Saan " + "Simmo Saan ", + "e-neko " ], "repository": { "type": "git",