aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/peertube-socket.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/lib/peertube-socket.ts
parent40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff)
downloadPeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.gz
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.zst
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.zip
esModuleInterop to true
Diffstat (limited to 'server/lib/peertube-socket.ts')
-rw-r--r--server/lib/peertube-socket.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/lib/peertube-socket.ts b/server/lib/peertube-socket.ts
index 0740e378e..901435dea 100644
--- a/server/lib/peertube-socket.ts
+++ b/server/lib/peertube-socket.ts
@@ -1,23 +1,23 @@
1import { Server } from 'http' 1import { Server as HTTPServer } from 'http'
2import * as SocketIO from 'socket.io' 2import { Namespace, Server as SocketServer, Socket } from 'socket.io'
3import { isIdValid } from '@server/helpers/custom-validators/misc'
3import { MVideo } from '@server/types/models' 4import { MVideo } from '@server/types/models'
4import { UserNotificationModelForApi } from '@server/types/models/user' 5import { UserNotificationModelForApi } from '@server/types/models/user'
5import { LiveVideoEventPayload, LiveVideoEventType } from '@shared/models' 6import { LiveVideoEventPayload, LiveVideoEventType } from '@shared/models'
6import { logger } from '../helpers/logger' 7import { logger } from '../helpers/logger'
7import { authenticateSocket } from '../middlewares' 8import { authenticateSocket } from '../middlewares'
8import { isIdValid } from '@server/helpers/custom-validators/misc'
9 9
10class PeerTubeSocket { 10class PeerTubeSocket {
11 11
12 private static instance: PeerTubeSocket 12 private static instance: PeerTubeSocket
13 13
14 private userNotificationSockets: { [ userId: number ]: SocketIO.Socket[] } = {} 14 private userNotificationSockets: { [ userId: number ]: Socket[] } = {}
15 private liveVideosNamespace: SocketIO.Namespace 15 private liveVideosNamespace: Namespace
16 16
17 private constructor () {} 17 private constructor () {}
18 18
19 init (server: Server) { 19 init (server: HTTPServer) {
20 const io = new SocketIO.Server(server) 20 const io = new SocketServer(server)
21 21
22 io.of('/user-notifications') 22 io.of('/user-notifications')
23 .use(authenticateSocket) 23 .use(authenticateSocket)