Builtin Prosody: use Peertube domain instead of localhost.

This commit is contained in:
John Livingston
2021-05-06 13:31:55 +02:00
parent 2e7c5b295a
commit f590cf2c7b
6 changed files with 43 additions and 19 deletions

View File

@ -0,0 +1,12 @@
async function getProsodyDomain (options: RegisterServerOptions): Promise<string> {
const url = options.peertubeHelpers.config.getWebserverUrl()
const matches = url.match(/^https?:\/\/([^:/]*)(:\d+)?(\/|$)/)
if (!matches) {
throw new Error(`Cant get a domain name from url '${url}'`)
}
return matches[1]
}
export {
getProsodyDomain
}