stream-url
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -28,3 +28,6 @@ "use strict"; | ||
} | ||
var u = url.parse(stream_url.toString()); | ||
var u = stream_url.constructor===url.Url ? stream_url : | ||
url.parse(stream_url.toString()); | ||
if (!u || !u.protocol) | ||
throw new Error('invalid URL: ' + stream_url); | ||
var proto = u.protocol.substr(0, u.protocol.length-1); | ||
@@ -31,0 +34,0 @@ var adaptor = adaptors[proto]; |
{ | ||
"name": "stream-url", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"homepage": "http://github.com/gritzko/stream-url", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -11,3 +11,3 @@ "use strict"; | ||
tape ('1.A create echo server', function (t) { | ||
tape ('2.A create echo server', function (t) { | ||
var port = Math.floor(Math.random()*10000) + 2000; | ||
@@ -46,3 +46,3 @@ var url = 'tcp://localhost:'+port; | ||
tape ('1.B listen fails', function (t) { | ||
tape ('2.B listen fails', function (t) { | ||
t.plan(2); | ||
@@ -56,3 +56,3 @@ var server = su.listen('tcp://localhost:1', function on_fail(err, serv) { | ||
tape ('1.C connect fails', function (t) { | ||
tape ('2.C connect fails', function (t) { | ||
var url = 'tcp://localhost:1'; | ||
@@ -68,3 +68,3 @@ var stream = su.connect(url, function (err, socket) { | ||
tape ('1.D connect and disconnect', function (t) { | ||
tape ('2.D connect and disconnect', function (t) { | ||
var port = Math.floor(Math.random()*10000) + 2000; | ||
@@ -71,0 +71,0 @@ var url = 'tcp://localhost:' + port; |
20268
526