Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 2.1.0 to 2.2.0

2

package.json
{
"name": "websocket-stream",
"version": "2.1.0",
"version": "2.2.0",
"license": "BSD-2-Clause",

@@ -5,0 +5,0 @@ "description": "Use websockets with the node streams API. Works in browser and node",

@@ -31,3 +31,3 @@ # websocket-stream

fs.createReadStream('bigdata.json').pipe(stream)
})
}
```

@@ -34,0 +34,0 @@

@@ -15,4 +15,6 @@

var proxied = false
this.on('newListener', function(event) {
if (event === 'stream') {
if (!proxied && event === 'stream') {
proxied = true
this.on('connection', function(conn) {

@@ -19,0 +21,0 @@ this.emit('stream', stream(conn))

@@ -191,1 +191,19 @@ var test = require('tape')

})
test('stream handlers should fire once per connection', function(t) {
t.plan(1)
var server = http.createServer()
var wss = websocket.createServer({ server: server }, function() {
server.close(function() {
t.equal(m, 1)
})
})
var m = 0
wss.on('stream', function() { m++ })
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