websocket-stream
Advanced tools
Comparing version 1.4.0 to 1.5.0
{ | ||
"name": "websocket-stream", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "Use websockets with the node streams API. Works in browser and node", | ||
@@ -34,2 +34,3 @@ "scripts": { | ||
"browserify": "^5.11.1", | ||
"concat-stream": "^1.4.7", | ||
"tape": "^2.14.0" | ||
@@ -36,0 +37,0 @@ }, |
@@ -63,2 +63,3 @@ var through = require('through2') | ||
function onclose() { | ||
stream.end(); | ||
stream.destroy() | ||
@@ -65,0 +66,0 @@ } |
19
test.js
@@ -6,2 +6,3 @@ var test = require('tape') | ||
var http = require('http') | ||
var concat = require('concat-stream') | ||
@@ -173,1 +174,19 @@ test('echo server', function(t) { | ||
}) | ||
test('stream end', function(t) { | ||
t.plan(1) | ||
var server = http.createServer() | ||
websocket.createServer({ server: server }, handle) | ||
function handle (stream) { | ||
stream.pipe(concat(function (body) { | ||
t.equal(body.toString(), 'pizza cats\n') | ||
server.close() | ||
})) | ||
} | ||
server.listen(0, function () { | ||
var w = websocket('ws://localhost:' + server.address().port) | ||
w.end('pizza cats\n') | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12351
306
4