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

it-ws

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

it-ws - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

8

duplex.js

@@ -6,3 +6,2 @@ const source = require('./source')

options = options || {}
const req = socket.upgradeReq || {}

@@ -17,9 +16,4 @@ if (options.binaryType) {

sink: sink(socket, options),
source: source(socket, options),
// http properties - useful for routing or auth.
headers: req.headers,
url: req.url,
upgrade: req.upgrade,
method: req.method
source: source(socket, options)
}
}

4

package.json
{
"name": "it-ws",
"version": "1.0.0",
"version": "2.0.0",
"description": "Simple async iterables for websocket client connections",

@@ -30,3 +30,3 @@ "main": "index.js",

"safe-buffer": "^5.1.2",
"ws": "^1.1.0"
"ws": "^6.2.1"
},

@@ -33,0 +33,0 @@ "devDependencies": {

@@ -41,6 +41,6 @@ var ws = require('./')

wsServer.on('connection', function (socket) {
wsServer.on('connection', function (socket, req) {
var stream = ws(socket)
stream.remoteAddress = socket.upgradeReq.socket.remoteAddress
emitter.emit('connection', stream)
stream.remoteAddress = req.socket.remoteAddress
emitter.emit('connection', stream, req)
})

@@ -47,0 +47,0 @@

@@ -28,4 +28,4 @@ var WebSocketServer = require('ws').Server

wss.on('connection', function (ws) {
var match = router.match(ws.upgradeReq.url)
wss.on('connection', function (ws, req) {
var match = router.match(req.url)
if (match && typeof match.fn === 'function') {

@@ -32,0 +32,0 @@ match.fn(ws)

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