From 86271f6ad01f1a8e5876f5c3372887c5be6bdb5a Mon Sep 17 00:00:00 2001 From: Rocco Zanni Date: Mon, 8 Sep 2014 23:24:20 +0200 Subject: [PATCH] Add server password. Add rejectUnauthorized to disable SSL verification --- src/client.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/client.js b/src/client.js index 7011d186..ef625b3f 100644 --- a/src/client.js +++ b/src/client.js @@ -72,10 +72,11 @@ Client.prototype.find = function(id) { Client.prototype.connect = function(args) { var client = this; - var server = { - host: args.host || "irc.freenode.org", - port: args.port || 6667 - }; + var server = _.defaults(_.pick(args, ['host', 'port', 'rejectUnauthorized']), { + host: "irc.freenode.org", + port: 6667, + rejectUnauthorized: true + }); var stream = args.tls ? tls.connect(server) : net.connect(server); stream.on("error", function(e) { @@ -86,6 +87,11 @@ Client.prototype.connect = function(args) { var realname = args.realname || "Shout User"; var irc = slate(stream); + + if (args.password) { + irc.pass(args.password); + } + irc.me = nick; irc.nick(nick); irc.user(nick, realname);