Open guusdk opened 3 years ago
Can you provide more concrete details?
There already is code to switch between BOSH and websocket: https://github.com/conversejs/converse.js/blob/4e3a81d697493f43451d9977576cfb310fe9b4c1/src/headless/converse-core.js#L374
And both BOSH and websocket endpoints are taken from .well-know/host-meta
.
Converse however doesn't support multiple websocket or BOSH endpoints. Is that the problem you're having
I've noticed this problem on Ignite, which at the time of writing, has this in https://igniterealtime.org/.well-known/host-meta
<?xml version='1.0' encoding='utf-8'?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="urn:xmpp:alt-connections:xbosh" href="https://igniterealtime.org:443/http-bind/"/>
<Link rel="urn:xmpp:alt-connections:websocket" href="wss://xmpp.igniterealtime.org:7483/ws/"/>
</XRD>
Converse seems to prefer the websocket link, which it tries, but fails to use (some kind of CORS issue, but I don't think that's relevant to the issue at hand).
When I configure Converse to not do discovery of connection methods, and specify a bosh_service_url
that matches the endpoint of the bosh link above, Converse happily connects.
{
"discover_connection_methods": false,
"default_domain": "igniterealtime.org",
"bosh_service_url": "https://igniterealtime.org:443/http-bind/"
}
This leads me to believe that Converse does not attempt all Links that are in .well-known/host-meta
When Converse fails to connect to the XMPP server, it should attempt to reconnect using other connection configuration, if that's available.
For example, when using XEP-0156, other
Link
s should be attempted, if the first one fails.