diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-09 13:15:40 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-09 13:15:40 +0100 |
commit | 1e9d7b60cd93ad5d1aed47fd157f1993d4b4eac0 (patch) | |
tree | 4b15a32c622877c93ca334f43be678856f99c14e /server.ts | |
parent | 53ac1448f073a5db69f934550404c6997822501e (diff) | |
download | PeerTube-1e9d7b60cd93ad5d1aed47fd157f1993d4b4eac0.tar.gz PeerTube-1e9d7b60cd93ad5d1aed47fd157f1993d4b4eac0.tar.zst PeerTube-1e9d7b60cd93ad5d1aed47fd157f1993d4b4eac0.zip |
Fix crash with websocket tracker
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -104,11 +104,11 @@ const trackerServer = new TrackerServer({ | |||
104 | }) | 104 | }) |
105 | 105 | ||
106 | trackerServer.on('error', function (err) { | 106 | trackerServer.on('error', function (err) { |
107 | logger.error(err) | 107 | logger.error('Error in websocket tracker.', err) |
108 | }) | 108 | }) |
109 | 109 | ||
110 | trackerServer.on('warning', function (err) { | 110 | trackerServer.on('warning', function (err) { |
111 | logger.error(err) | 111 | logger.error('Warning in websocket tracker.', err) |
112 | }) | 112 | }) |
113 | 113 | ||
114 | const server = http.createServer(app) | 114 | const server = http.createServer(app) |
@@ -116,7 +116,6 @@ const wss = new WebSocketServer({ server: server, path: '/tracker/socket' }) | |||
116 | wss.on('connection', function (ws) { | 116 | wss.on('connection', function (ws) { |
117 | trackerServer.onWebSocketConnection(ws) | 117 | trackerServer.onWebSocketConnection(ws) |
118 | }) | 118 | }) |
119 | wss.on('error', err => logger.error('Error in websocket server.', err)) | ||
120 | 119 | ||
121 | const onHttpRequest = trackerServer.onHttpRequest.bind(trackerServer) | 120 | const onHttpRequest = trackerServer.onHttpRequest.bind(trackerServer) |
122 | app.get('/tracker/announce', (req, res) => onHttpRequest(req, res, { action: 'announce' })) | 121 | app.get('/tracker/announce', (req, res) => onHttpRequest(req, res, { action: 'announce' })) |