diff options
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' })) |