Need help troubleshooting why http-bind is called on one server but not another

I need a hint from someone who knows the nuts and bolts better than me. I have an app that makes calls to the Jitsi API via iframe using a self-hosted Jitsi.

For testing, I have a local network VM serving Docker Jitsi and then a public server with the same setup, but a different domain. Firewall settings are identical. I can note two differences:

  1. in the local VM, the .env variable for DOCKER_HOST_ADDRESS is showing the local ip address
  2. In the browser Console when the two are running, the local VM shows
    Got xmpp version: Prosody(0.11.5,Linux)
    while the public instance is showing
    Got xmpp version: Prosody(0.11.7,Linux)

I am seeing that the local VM is calling out to the /http-bind/?room every 10 seconds, and the public one is not. Instead, the public one is calling to /xmpp-websocket/?room once as a websocket.

The thing is, they are built from the same project repo, and have the same configuration. It is very surprising to me to see the difference in websocket connection on public but http-bind on the local. I’m trying to figure out what is causing this difference. I am having trouble with the public one in a scenario where the internet connection changes and creates a ghost user. I have written code on the local test VM which handles this fine…but the public one just disconnects with the same code. To me the difference appears to be in the lack of http-bind calls on the public server.

If the containers are configured the same, what would cause this difference? I am not sure how the Prosody versions ended up different. Maybe to someone else this will be obvious.

Compare the config.js, the http-bind is using bosh, the other one is using websockets, this setting is coming from config.js

In Docker, which config files feed this? My system-config.js are identical:

{{ $CONFIG_EXTERNAL_CONNECT := .Env.CONFIG_EXTERNAL_CONNECT | default "false" | toBool -}}
{{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "false" | toBool -}}
{{ $ENABLE_GUESTS := .Env.ENABLE_GUESTS | default "false" | toBool -}}
{{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "false" | toBool -}}
{{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool -}}
{{ $JICOFO_AUTH_USER := .Env.JICOFO_AUTH_USER | default "focus" }}
{{ $PUBLIC_URL_DOMAIN := .Env.PUBLIC_URL | default "https://localhost:8443" | trimPrefix "https://" | trimSuffix "/" -}}
{{ $XMPP_MUC_DOMAIN_PREFIX := (split "." .Env.XMPP_MUC_DOMAIN)._0  -}}

// Begin default config overrides.

if (!config.hasOwnProperty('hosts')) config.hosts = {};

config.hosts.domain = '{{ $XMPP_DOMAIN }}';
config.focusUserJid = '{{$JICOFO_AUTH_USER}}@{{$XMPP_AUTH_DOMAIN}}';

var subdomain = "<!--# echo var="subdomain" default="" -->";
if (subdomain) {
    subdomain = subdomain.substr(0,subdomain.length-1).split('.').join('_').toLowerCase() + '.';
config.hosts.muc = '{{ $XMPP_MUC_DOMAIN_PREFIX }}.'+subdomain+'{{ $XMPP_DOMAIN }}';
{{ else -}}
config.hosts.muc = '{{ $XMPP_MUC_DOMAIN }}';
{{ end -}}

{{ if $ENABLE_AUTH -}}
{{ if $ENABLE_GUESTS -}}
// When using authentication, domain for guest users.
config.hosts.anonymousdomain = '{{ .Env.XMPP_GUEST_DOMAIN }}';
{{ end -}}
// Domain for authenticated users. Defaults to <domain>.
config.hosts.authdomain = '{{ $XMPP_DOMAIN }}';
{{ end -}}

config.bosh = '/http-bind';
config.websocket = 'wss://{{ $PUBLIC_URL_DOMAIN }}/xmpp-websocket';
{{ end -}}

config.externalConnectUrl = '/<!--# echo var="subdir" default="" -->http-pre-bind';
{{ else -}}
config.externalConnectUrl = '/http-pre-bind';
{{ end -}}
{{ end -}}


Is that set on both? On the one using bosh only $ENABLE_XMPP_WEBSOCKET is 0.

1 Like

@damencho Yeah, set same on both. When I change the websocket to 0 on the public it does start the bosh calls. On the local VM when I turn websocket to 1 it doesn’t do websockets.

But, thank you for helping me know how to get bosh going.