Videobridge2 - facing websocket error from videobridge hosted on another server

We have Jitsi running fine with the following architecture -
Server 1: Jitsi and related components, Videobridge2
Server 2: Jibri

In order to provide scaling up, we set up additional videobridge servers. However, when we run a conference using Videobridge from another server, screenshare is very blurred and we see some websocket errors in browser’s console log. Please let us know what might be wrong. Appreciate your help.

[modules/RTC/BridgeChannel.js] <e.onclose>: Channel closed by server
Logger.js:154 2022-12-22T06:59:35.866Z [modules/RTC/BridgeChannel.js] <e.onclose>: Channel closed: 1006
r @ Logger.js:154
e.onclose @ BridgeChannel.js:443
Logger.js:154 2022-12-22T06:59:49.510Z [modules/RTC/ScreenObtainer.js] <Object.obtainScreenFromGetDisplayMedia>: Using getDisplayMedia for screen sharing {video: {…}, audio: true, cursor: ‘always’}

BridgeChannel.js:84 WebSocket connection to ‘wss://meet.MYDOMAIN.com/colibri-ws/default-id/4298d4ff08439854/f093298f?pwd=1he8ejqp3limqvl1nbdvmfjon7’ failed:
_initWebSocket @ BridgeChannel.js:84
t @ BridgeChannel.js:103

Logger.js:154 2022-12-22T06:59:51.864Z [modules/RTC/BridgeChannel.js] <e.onclose>: Channel closed by server
Logger.js:154 2022-12-22T06:59:51.865Z [modules/RTC/BridgeChannel.js] <e.onclose>: Channel closed: 1006
r @ Logger.js:154
e.onclose @ BridgeChannel.js:443
Logger.js:154 2022-12-22T06:59:57.339Z [modules/xmpp/JingleSessionPC.js] <Object.callback>: JingleSessionPC[session=JVB,initiator=false,sid=17qdip6c5tog8] Replace track done!

You need to fix the nginx config for colibri-ws to reach the other jvb and probably have the jvbs have their own up address and don’t use the default id.

You mean fix the nginx config in Server1 (hosting Jitsi, prosody etc) in order to reach Videobridge on Server3 ?

Thank you, will try

I added location redirection in nginx as below.

colibri (JVB) websockets for additional JVBs

location ~ ^/colibri-ws/(.*)/(.*) {
    proxy_pass http://$1:9090/colibri-ws/$1/$2$is_args$args;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    tcp_nodelay on;
}

To test, specified a unique ID for the remote JVB as below.
websockets {
enabled = true
server-id=“9eiu83784uiueuirujnsd98734ijik”
domain = “meet.MYDOMAIN.com:443
tls = true
}

Still we get websocket failed error. Where did we make the mistake ?

bSocket connection to ‘wss://meet.MYDOMAIN.com/colibri-ws/9eiu83784uiueuirujnsd98734ijik/7c9937de6d7f4310/c85eb34e?pwd=7nmtjfq1h4p7c88hlcorpprsdl’ failed:
_initWebSocket @ BridgeChannel.js:84
t @ BridgeChannel.js:103

“server-id” should be the IP of JVB

But that IP will keep changing as that instance is dynamically created. You meant IP of JVB that is on remote server, right ?

But the nginx rule is dynamic, it extracts the IP address from the URL and uses it.

You should update this IP while creating the instance.

/usr/local/sbin/jvb-config
/etc/systemd/system/jvb-config.service

1 Like

I updated the IP using a service and shell script as you recommended, the external IP is getting set to server-id in jvb.conf but I still see the same websocket error. Is my nginx rule correct or did I make some mistake ?

websockets {
enabled = true
server-id=“EXTERNAL IP”
domain = “meet.MYDOMAIN.com:443
tls = true
}

BridgeChannel.js:84 WebSocket connection to ‘wss://meet.MYDOMAIN.com/colibri-ws/EXTERNAL_IP/bad2ebd40f93202/4e27dedd?pwd=4h59eskn61oloclqg5q25gj47b’ failed:
_initWebSocket @ BridgeChannel.js:84
t @ BridgeChannel.js:103
Logger.js:154 2022-12-23T10:03:41.035Z [modules/RTC/BridgeChannel.js] <e.onclose>: Channel closed by server
Logger.js:154 2022-12-23T10:03:41.035Z [modules/RTC/BridgeChannel.js] <e.onclose>: Channel closed: 1006

There was indeed a mistake in my nginx rule. Instead of ([0-9.])/(.) I had put (.)/(.)

Fixed that now and with the script you shared to set the IP dynamically, screenshare is working fine on remote JVB. Thank you both for your help as you always do !