Skip to content

Commit 8c28f02

Browse files
committed
Fixes for ws@3
1 parent 3db8bf9 commit 8c28f02

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@ function Server (opts) {
127127
return self.http.address()
128128
}
129129
self.ws.on('error', function (err) { self._onError(err) })
130-
self.ws.on('connection', function (socket) { self.onWebSocketConnection(socket) })
130+
self.ws.on('connection', function (socket, req) {
131+
// Note: socket.upgradeReq was removed in [email protected], so re-add it.
132+
// https://github.com/websockets/ws/pull/1099
133+
socket.upgradeReq = req
134+
self.onWebSocketConnection(socket)
135+
})
131136
}
132137

133138
if (opts.stats !== false) {

0 commit comments

Comments
 (0)