aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-09 10:34:11 +0100
committerChocobozzz <me@florianbigard.com>2018-02-09 10:34:11 +0100
commitbc4c766aca72c2b09b555895452b9b3e25cd85fe (patch)
tree60c0df8a10317e325c76c6ee6e207f8c69f48c2f /server.ts
parentc525c093751aba9f1152adbe405daae20a0dc400 (diff)
downloadPeerTube-bc4c766aca72c2b09b555895452b9b3e25cd85fe.tar.gz
PeerTube-bc4c766aca72c2b09b555895452b9b3e25cd85fe.tar.zst
PeerTube-bc4c766aca72c2b09b555895452b9b3e25cd85fe.zip
Handle error on websocket error
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/server.ts b/server.ts
index 44e93d1a6..8f280f6c2 100644
--- a/server.ts
+++ b/server.ts
@@ -116,6 +116,7 @@ const wss = new WebSocketServer({ server: server, path: '/tracker/socket' })
116wss.on('connection', function (ws) { 116wss.on('connection', function (ws) {
117 trackerServer.onWebSocketConnection(ws) 117 trackerServer.onWebSocketConnection(ws)
118}) 118})
119wss.on('error', err => logger.error('Error in websocket server.', err))
119 120
120const onHttpRequest = trackerServer.onHttpRequest.bind(trackerServer) 121const onHttpRequest = trackerServer.onHttpRequest.bind(trackerServer)
121app.get('/tracker/announce', (req, res) => onHttpRequest(req, res, { action: 'announce' })) 122app.get('/tracker/announce', (req, res) => onHttpRequest(req, res, { action: 'announce' }))