Implements #123: «disable websocket» settings».
This commit is contained in:
parent
74cf60908e
commit
ae5860e537
@ -99,6 +99,15 @@ If this AppImage is not working, you can fallback to the Prosody that is package
|
||||
|
||||
This settings should only be used if the plugin is broken, and waiting for a patch.
|
||||
|
||||
#### Disable Websocket
|
||||
|
||||
With Peertube >= 5.0.0, this plugin try to use Websocket connection for chatting.
|
||||
If the user's browser or connection is not compatible, the browser will automatically fallback on the BOSH protocol.
|
||||
|
||||
But in rare case, this can fail. For example if you have a reverse proxy in front of Peertube that does not
|
||||
allow Websocket connection for plugins.
|
||||
In this case, you can check this settings to disable Websocket connections.
|
||||
|
||||
#### Prosody port
|
||||
|
||||
This is the port that the Prosody server will use. By default it is set to 52800. If you want to use another port, just change the value here.
|
||||
|
2374
package-lock.json
generated
2374
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -44,11 +44,14 @@ async function initWebchatRouter (options: RegisterServerOptionsV5): Promise<Rou
|
||||
const roomKey = req.params.roomKey
|
||||
const settings = await settingsManager.getSettings([
|
||||
'prosody-room-type',
|
||||
'disable-websocket',
|
||||
'converse-theme', 'converse-autocolors'
|
||||
])
|
||||
|
||||
const boshUri = getBaseRouterRoute(options) + 'http-bind'
|
||||
let wsUri = getBaseWebSocketRoute(options) // can be undefined
|
||||
let wsUri = settings['disable-websocket']
|
||||
? undefined
|
||||
: getBaseWebSocketRoute(options) // can be undefined
|
||||
wsUri = wsUri !== undefined ? wsUri + 'xmpp-websocket' : ''
|
||||
|
||||
let room: string
|
||||
@ -341,7 +344,7 @@ async function enableProxyRoute (
|
||||
logger.error(
|
||||
'The http bind proxy got an error ' +
|
||||
'(this can be normal if you updated/uninstalled the plugin, or shutdowned peertube while users were chatting): ' +
|
||||
(err.message as string)
|
||||
err.message
|
||||
)
|
||||
if ('writeHead' in res) {
|
||||
res.writeHead(500)
|
||||
@ -363,7 +366,7 @@ async function enableProxyRoute (
|
||||
logger.error(
|
||||
'The websocket proxy got an error ' +
|
||||
'(this can be normal if you updated/uninstalled the plugin, or shutdowned peertube while users were chatting): ' +
|
||||
(err.message as string)
|
||||
err.message
|
||||
)
|
||||
if ('writeHead' in res) {
|
||||
res.writeHead(500)
|
||||
|
@ -222,6 +222,20 @@ Only use this if you encounter problems with the embedded Prosody.`,
|
||||
default: false
|
||||
})
|
||||
|
||||
registerSetting({
|
||||
name: 'disable-websocket',
|
||||
type: 'input-checkbox',
|
||||
label: 'Disable Websocket',
|
||||
descriptionHTML: `With Peertube >= 5.0.0, this plugin try to use Websocket connection for chatting.
|
||||
If the user's browser or connection is not compatible, the browser will automatically fallback on the BOSH protocol.
|
||||
<br>
|
||||
But in rare case, this can fail. For example if you have a reverse proxy in front of Peertube that does not
|
||||
allow Websocket connection for plugins.
|
||||
In this case, you can check this settings to disable Websocket connections.`,
|
||||
private: true,
|
||||
default: false
|
||||
})
|
||||
|
||||
registerSetting({
|
||||
name: 'prosody-port',
|
||||
label: 'Prosody port',
|
||||
|
Loading…
x
Reference in New Issue
Block a user