mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 12:11:36 +00:00
Fixes for ws@3
This commit is contained in:
parent
3db8bf94e0
commit
8c28f025b4
@ -127,7 +127,12 @@ function Server (opts) {
|
|||||||
return self.http.address()
|
return self.http.address()
|
||||||
}
|
}
|
||||||
self.ws.on('error', function (err) { self._onError(err) })
|
self.ws.on('error', function (err) { self._onError(err) })
|
||||||
self.ws.on('connection', function (socket) { self.onWebSocketConnection(socket) })
|
self.ws.on('connection', function (socket, req) {
|
||||||
|
// Note: socket.upgradeReq was removed in ws@3.0.0, so re-add it.
|
||||||
|
// https://github.com/websockets/ws/pull/1099
|
||||||
|
socket.upgradeReq = req
|
||||||
|
self.onWebSocketConnection(socket)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.stats !== false) {
|
if (opts.stats !== false) {
|
||||||
|
Loading…
Reference in New Issue
Block a user