aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/tracker.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-27 14:32:44 +0200
committerChocobozzz <me@florianbigard.com>2021-08-27 15:12:22 +0200
commit41fb13c330de629df2d23379209e79c7af0f2e9a (patch)
tree73bc5a90566406b3910f142beae2a879c1e4265d /server/controllers/tracker.ts
parent40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff)
downloadPeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.gz
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.zst
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.zip
esModuleInterop to true
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) {