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

19 lines
449 B
TypeScript
Raw Normal View History

2020-11-19 07:58:34 +00:00
import { io } from 'socket.io-client'
2018-12-26 09:36:24 +00:00
function getUserNotificationSocket (serverUrl: string, accessToken: string) {
return io(serverUrl + '/user-notifications', {
query: { accessToken }
})
}
2020-11-04 14:31:32 +00:00
function getLiveNotificationSocket (serverUrl: string) {
return io(serverUrl + '/live-videos')
}
2018-12-26 09:36:24 +00:00
// ---------------------------------------------------------------------------
export {
2020-11-04 14:31:32 +00:00
getUserNotificationSocket,
getLiveNotificationSocket
2018-12-26 09:36:24 +00:00
}