From aea4ed43bcdc7032c082214ffce3395bf1a6902b Mon Sep 17 00:00:00 2001 From: Mykola Bilochub Date: Fri, 5 May 2017 18:58:58 +0300 Subject: [PATCH] tcp: fix URL parsing in client creation PR-URL: https://github.com/metarhia/JSTP/pull/128 Reviewed-By: Alexey Orlenko --- lib/transport.tcp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/transport.tcp.js b/lib/transport.tcp.js index dda958c..075b6dd 100644 --- a/lib/transport.tcp.js +++ b/lib/transport.tcp.js @@ -43,9 +43,9 @@ function parseUrl(urlString) { const urlObject = url.parse(urlString); const config = {}; - if (urlObject.protocol === 'jstp') { + if (urlObject.protocol === 'jstp:') { config.secure = false; - } else if (urlObject.protocol === 'jstps') { + } else if (urlObject.protocol === 'jstps:') { config.secure = true; } else { throw new Error('Invalid URL schema');