diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-27 14:32:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-27 15:12:22 +0200 |
commit | 41fb13c330de629df2d23379209e79c7af0f2e9a (patch) | |
tree | 73bc5a90566406b3910f142beae2a879c1e4265d /server/lib/peertube-socket.ts | |
parent | 40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff) | |
download | PeerTube-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.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) |