Socket
Socket
Sign inDemoInstall

websocket-stream

Package Overview
Dependencies
Maintainers
5
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 4.0.0 to 5.0.0

4

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

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

"safe-buffer": "^5.0.1",
"ws": "^2.2.3",
"ws": "^3.0.0",
"xtend": "^4.0.0"

@@ -33,0 +33,0 @@ },

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

The available options differs depending on if you use this module in the browser or with node.js. Options can be passed in as the third or second argument - `WebSocket(address, [protocols], [options])`
The available options differs depending on if you use this module in the browser or with node.js. Options can be passed in as the third or second argument - `WebSocket(address, [protocols], [options])`.

@@ -58,3 +58,3 @@ ##### `options.browserBufferSize`

Default: `true`
Default: `true` on the client, `false` on the server.

@@ -70,2 +70,4 @@ Example:

Beware that this option is ignored by browser clients. To make sure that permessage-deflate is never used, disable it on the server.
##### Other options

@@ -83,3 +85,4 @@

function handle(stream) {
function handle(stream, request) {
// `request` is the upgrade request sent by the client.
fs.createReadStream('bigdata.json').pipe(stream)

@@ -86,0 +89,0 @@ }

@@ -14,4 +14,4 @@ 'use strict'

proxied = true
this.on('connection', function(conn) {
this.emit('stream', stream(conn, opts))
this.on('connection', function(conn, req) {
this.emit('stream', stream(conn, opts), req)
})

@@ -18,0 +18,0 @@ }

@@ -196,6 +196,6 @@ var test = require('tape')

t.plan(1)
var server = http.createServer()
websocket.createServer({ server: server }, handle)
function handle (stream) {

@@ -214,3 +214,3 @@ stream.pipe(concat(function (body) {

test('stream handlers should fire once per connection', function(t) {
t.plan(1)
t.plan(2)

@@ -225,3 +225,6 @@ var server = http.createServer()

var m = 0
wss.on('stream', function() { m++ })
wss.on('stream', function(stream, request) {
t.ok(request instanceof http.IncomingMessage)
m++
})
server.listen(0, function() {

@@ -228,0 +231,0 @@ var w = websocket('ws://localhost:' + server.address().port)

Sorry, the diff of this file is not supported yet

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