mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
esModuleInterop to true
This commit is contained in:
parent
40e7ed0714
commit
41fb13c330
208 changed files with 444 additions and 425 deletions
|
@ -1,23 +1,23 @@
|
|||
import { Server } from 'http'
|
||||
import * as SocketIO from 'socket.io'
|
||||
import { Server as HTTPServer } from 'http'
|
||||
import { Namespace, Server as SocketServer, Socket } from 'socket.io'
|
||||
import { isIdValid } from '@server/helpers/custom-validators/misc'
|
||||
import { MVideo } from '@server/types/models'
|
||||
import { UserNotificationModelForApi } from '@server/types/models/user'
|
||||
import { LiveVideoEventPayload, LiveVideoEventType } from '@shared/models'
|
||||
import { logger } from '../helpers/logger'
|
||||
import { authenticateSocket } from '../middlewares'
|
||||
import { isIdValid } from '@server/helpers/custom-validators/misc'
|
||||
|
||||
class PeerTubeSocket {
|
||||
|
||||
private static instance: PeerTubeSocket
|
||||
|
||||
private userNotificationSockets: { [ userId: number ]: SocketIO.Socket[] } = {}
|
||||
private liveVideosNamespace: SocketIO.Namespace
|
||||
private userNotificationSockets: { [ userId: number ]: Socket[] } = {}
|
||||
private liveVideosNamespace: Namespace
|
||||
|
||||
private constructor () {}
|
||||
|
||||
init (server: Server) {
|
||||
const io = new SocketIO.Server(server)
|
||||
init (server: HTTPServer) {
|
||||
const io = new SocketServer(server)
|
||||
|
||||
io.of('/user-notifications')
|
||||
.use(authenticateSocket)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue