aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/tracker.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/tracker.ts')
-rw-r--r--server/controllers/tracker.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/server/controllers/tracker.ts b/server/controllers/tracker.ts
index 37f8f12c9..da9c68c6c 100644
--- a/server/controllers/tracker.ts
+++ b/server/controllers/tracker.ts
@@ -1,7 +1,7 @@
1import * as bitTorrentTracker from 'bittorrent-tracker' 1import { Server as TrackerServer } from 'bittorrent-tracker'
2import * as express from 'express' 2import express from 'express'
3import * as http from 'http' 3import { createServer } from 'http'
4import * as proxyAddr from 'proxy-addr' 4import proxyAddr from 'proxy-addr'
5import { Server as WebSocketServer } from 'ws' 5import { Server as WebSocketServer } from 'ws'
6import { Redis } from '@server/lib/redis' 6import { Redis } from '@server/lib/redis'
7import { logger } from '../helpers/logger' 7import { logger } from '../helpers/logger'
@@ -10,8 +10,6 @@ import { TRACKER_RATE_LIMITS } from '../initializers/constants'
10import { VideoFileModel } from '../models/video/video-file' 10import { VideoFileModel } from '../models/video/video-file'
11import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist' 11import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist'
12 12
13const TrackerServer = bitTorrentTracker.Server
14
15const trackerRouter = express.Router() 13const trackerRouter = express.Router()
16 14
17let peersIps = {} 15let peersIps = {}
@@ -86,7 +84,7 @@ trackerRouter.get('/tracker/announce', (req, res) => onHttpRequest(req, res, { a
86trackerRouter.get('/tracker/scrape', (req, res) => onHttpRequest(req, res, { action: 'scrape' })) 84trackerRouter.get('/tracker/scrape', (req, res) => onHttpRequest(req, res, { action: 'scrape' }))
87 85
88function createWebsocketTrackerServer (app: express.Application) { 86function createWebsocketTrackerServer (app: express.Application) {
89 const server = http.createServer(app) 87 const server = createServer(app)
90 const wss = new WebSocketServer({ noServer: true }) 88 const wss = new WebSocketServer({ noServer: true })
91 89
92 wss.on('connection', function (ws, req) { 90 wss.on('connection', function (ws, req) {