From b33dd88ac2fde492e3e3f822c84e2be5798890b8 Mon Sep 17 00:00:00 2001 From: deathcap Date: Mon, 18 Jan 2016 13:02:39 -0800 Subject: [PATCH] Make stream option optional, caller can setSocket() later --- src/createClientStream.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/createClientStream.js b/src/createClientStream.js index 72dce01..5da8e8e 100644 --- a/src/createClientStream.js +++ b/src/createClientStream.js @@ -8,7 +8,6 @@ module.exports=createClientStream; function createClientStream(options) { assert.ok(options, "options is required"); var stream = options.stream; - assert.ok(stream, "stream is required"); assert.ok(options.username, "username is required"); var keepAlive = options.keepAlive == null ? true : options.keepAlive; @@ -32,7 +31,7 @@ function createClientStream(options) { client.on("set_compression", onCompressionRequest); client.username = options.username; - client.setSocket(stream); + if (stream) client.setSocket(stream); var timeout = null; return client;