PeerTube/shared/extra-utils/socket/socket-io-command.ts

16 lines
459 B
TypeScript
Raw Normal View History

2021-07-07 11:55:16 +02:00
import { io } from 'socket.io-client'
import { AbstractCommand, OverrideCommandOptions } from '../shared'
export class SocketIOCommand extends AbstractCommand {
getUserNotificationSocket (options: OverrideCommandOptions = {}) {
return io(this.server.url + '/user-notifications', {
2021-07-07 16:02:46 +02:00
query: { accessToken: options.token ?? this.server.accessToken }
2021-07-07 11:55:16 +02:00
})
}
getLiveNotificationSocket () {
return io(this.server.url + '/live-videos')
}
}