projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c525c09
)
Handle error on websocket error
author
Chocobozzz
<me@florianbigard.com>
Fri, 9 Feb 2018 09:34:11 +0000
(10:34 +0100)
committer
Chocobozzz
<me@florianbigard.com>
Fri, 9 Feb 2018 09:34:11 +0000
(10:34 +0100)
server.ts
patch
|
blob
|
history
diff --git
a/server.ts
b/server.ts
index 44e93d1a6102324d97703cc9462b89b434305de2..8f280f6c2a07ee3c69b2d958d3a4db42b86a023f 100644
(file)
--- a/
server.ts
+++ b/
server.ts
@@
-116,6
+116,7
@@
const wss = new WebSocketServer({ server: server, path: '/tracker/socket' })
wss.on('connection', function (ws) {
trackerServer.onWebSocketConnection(ws)
})
+wss.on('error', err => logger.error('Error in websocket server.', err))
const onHttpRequest = trackerServer.onHttpRequest.bind(trackerServer)
app.get('/tracker/announce', (req, res) => onHttpRequest(req, res, { action: 'announce' }))