Socket
Socket
Sign inDemoInstall

websocket-stream

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websocket-stream - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

3

package.json
{
"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 @@ }

@@ -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')
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc