diff options
Diffstat (limited to 'server/lib/peertube-socket.ts')
-rw-r--r-- | server/lib/peertube-socket.ts | 14 |
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 @@ | |||
1 | import { Server } from 'http' | 1 | import { Server as HTTPServer } from 'http' |
2 | import * as SocketIO from 'socket.io' | 2 | import { Namespace, Server as SocketServer, Socket } from 'socket.io' |
3 | import { isIdValid } from '@server/helpers/custom-validators/misc' | ||
3 | import { MVideo } from '@server/types/models' | 4 | import { MVideo } from '@server/types/models' |
4 | import { UserNotificationModelForApi } from '@server/types/models/user' | 5 | import { UserNotificationModelForApi } from '@server/types/models/user' |
5 | import { LiveVideoEventPayload, LiveVideoEventType } from '@shared/models' | 6 | import { LiveVideoEventPayload, LiveVideoEventType } from '@shared/models' |
6 | import { logger } from '../helpers/logger' | 7 | import { logger } from '../helpers/logger' |
7 | import { authenticateSocket } from '../middlewares' | 8 | import { authenticateSocket } from '../middlewares' |
8 | import { isIdValid } from '@server/helpers/custom-validators/misc' | ||
9 | 9 | ||
10 | class PeerTubeSocket { | 10 | class 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) |