From 60cd78255ffe63bde63db2b785e0eb53d9e742c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Fr=C3=B6hle?= Date: Wed, 22 Jun 2016 22:18:36 +0200 Subject: [PATCH] Options for client should optional like the readme example fixes #14 --- lib/client.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/client.js b/lib/client.js index 70309ec..954a27b 100644 --- a/lib/client.js +++ b/lib/client.js @@ -94,6 +94,11 @@ function clientSession(sock, options) { * @param func callback(err, session) */ function client(options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + var sock = new net.Socket(); // Set default options