From 55ccaf502e4fdf233308942624c62e31198fdbb5 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Wed, 3 Apr 2013 20:04:21 +0100 Subject: [PATCH] Only require socks.js if running node 0.10 or above --- server/irc/connection.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/server/irc/connection.js b/server/irc/connection.js index 4560553..528c9a9 100644 --- a/server/irc/connection.js +++ b/server/irc/connection.js @@ -7,8 +7,18 @@ var net = require('net'), IrcServer = require('./server.js'), IrcChannel = require('./channel.js'), IrcUser = require('./user.js'), - Socks = require('../socks.js'); - + Socks; + + +// Break the Node.js version down into usable parts +var version_values = process.version.substr(1).split('.').map(function (item) { + return parseInt(item, 10); +}); + +// If we have a suitable Nodejs version, bring int he socks functionality +if (version_values[0] >= 10) { + Socks = require('../socks.js'); +} var IrcConnection = function (hostname, port, ssl, nick, user, pass, state) { var that = this; -- 2.25.1