peertube-plugin-livechat/server/lib/uri/webchat.ts
2023-04-19 19:07:08 +02:00

14 lines
518 B
TypeScript

import type { RegisterServerOptions } from '@peertube/peertube-types'
import { getBaseRouterRoute, getBaseWebSocketRoute } from '../helpers'
export function getBoshUri (options: RegisterServerOptions): string {
return getBaseRouterRoute(options) + 'http-bind'
}
export function getWSUri (options: RegisterServerOptions): string | undefined {
const base = getBaseWebSocketRoute(options) // can be undefined if Peertube is too old
if (base === undefined) { return undefined }
return base + 'xmpp-websocket'
}