Revert getProsodyDomain. Broken when not on localhot.

This commit is contained in:
John Livingston 2021-05-06 14:04:16 +02:00
parent 5650d6aed8
commit fec219a909
4 changed files with 14 additions and 8 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## v2.1.2
* Fix: revert 2.1.1, and revert using the real domain for prosody
## v2.1.1 ## v2.1.1
### Fixes ### Fixes

View File

@ -1,7 +1,7 @@
{ {
"name": "peertube-plugin-livechat", "name": "peertube-plugin-livechat",
"description": "PeerTube plugin livechat", "description": "PeerTube plugin livechat",
"version": "2.1.1", "version": "2.1.2",
"author": "John Livingston", "author": "John Livingston",
"bugs": "https://github.com/JohnXLivingston/peertube-plugin-livechat/issues", "bugs": "https://github.com/JohnXLivingston/peertube-plugin-livechat/issues",
"clientScripts": [ "clientScripts": [

View File

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

View File

@ -115,7 +115,7 @@ function changeHttpBindRoute ({ peertubeHelpers }: RegisterServerOptions, port:
proxyReqPathResolver: async (_req: Request): Promise<string> => { proxyReqPathResolver: async (_req: Request): Promise<string> => {
return '/http-bind' // should not be able to access anything else return '/http-bind' // should not be able to access anything else
}, },
preserveHostHdr: true, // preserveHostHdr: true,
parseReqBody: true // Note that setting this to false overrides reqAsBuffer and reqBodyEncoding below. parseReqBody: true // Note that setting this to false overrides reqAsBuffer and reqBodyEncoding below.
// FIXME: should we remove cookies? // FIXME: should we remove cookies?
} }