@Flow , thanks a lot for your response.
So I managed to connect to our server using an approach similiar to what is done here.
Here’s the code, might be useful for other people trying this out too.
String xmppDomain = "finesse.mycompany.com";
ModularXmppClientToServerConnectionConfiguration.Builder builder = ModularXmppClientToServerConnectionConfiguration.builder();
builder.removeAllModules()
.setXmppDomain(xmppDomain)
.setSendPresence(true)
.setHost(xmppDomain)
.setSecurityMode(ConnectionConfiguration.SecurityMode.required)
.setUsernameAndPassword(user.getLogin(), user.getPwd());
XmppWebSocketTransportModuleDescriptor.Builder websocketBuilder = XmppWebSocketTransportModuleDescriptor.getBuilder(builder);
websocketBuilder.explicitlySetWebSocketEndpointAndDiscovery("wss://" + xmppDomain + ":8445/ws/", true);
builder.addModule(websocketBuilder.build());
ModularXmppClientToServerConnectionConfiguration config = builder.build();
ModularXmppClientToServerConnection connection = new ModularXmppClientToServerConnection(config);
connection.connect();
connection.login();
I am able to connect, but after 30s I get following “error”:
Aug 18, 2022 9:46:45 AM org.jivesoftware.smack.websocket.okhttp.OkHttpWebSocket disconnect
INFO: WebSocket closing with code: 1000 and message: WebSocket closed normally
Aug 18, 2022 9:46:45 AM org.jivesoftware.smack.AbstractXMPPConnection callConnectionClosedOnErrorListener
Is there something I need to do in order to keep the connection alive? I searched in github and the docs etc. and didn’t really find anything. Or did I get something else wrong?
JFYI: I tried also using stanza (a JavaScript library) and there I can do the following, which actually keeps the connection alive.
client.enableKeepAlive();