Comparing version 1.0.0 to 2.0.0
@@ -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) | ||
} | ||
} |
{ | ||
"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) |
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
25065
604
+ Addedasync-limiter@1.0.1(transitive)
+ Addedws@6.2.3(transitive)
- Removedoptions@0.0.6(transitive)
- Removedultron@1.0.2(transitive)
- Removedws@1.1.5(transitive)
Updatedws@^6.2.1