aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/peertube-socket.ts
diff options
context:
space:
mode:
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)