From 59af480892696e012a9466b6e8d5e8744861da2e Mon Sep 17 00:00:00 2001 From: MindFreeze Date: Wed, 18 Mar 2015 14:08:43 +0200 Subject: [PATCH] Fix for #4 If your host is 192.168.56.3:9100 instead of http://192.168.56.3:9100 you get errorcode EINVAL which means nothing. #4 --- lib/api.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/api.js b/lib/api.js index 2c5b026..edc4cfa 100644 --- a/lib/api.js +++ b/lib/api.js @@ -6,6 +6,9 @@ function api(host) { if(typeof host == 'string') { + if (host.indexOf('http') !== 0) { + host = 'http://' + host; + } hostParts = Url.parse(host); if(hostParts.auth)