Source:
<code>protected List<SmackFuture<LookupConnectionEndpointsResult, Exception>> lookupConnectionEndpoints() { LOGGER.info("Looking up for endpoints"); assert discoveredWebsocketEndpoints == null; List<SmackFuture<LookupConnectionEndpointsResult, Exception>> futures = new ArrayList<>(2); InternalSmackFuture<LookupConnectionEndpointsResult, Exception> websocketEndpointsLookupFuture = new InternalSmackFuture<>(); connectionInternal.asyncGo(() -> { Result<WebsocketRemoteConnectionEndpoint> result = RemoteWebsocketConnectionEndpoints.lookup(connectionInternal); LookupConnectionEndpointsResult endpointsResult; if (result.discoveredRemoteConnectionEndpoints.isEmpty()) { endpointsResult = new WebsocketEndpointsDiscoveryFailed(result); } else { endpointsResult = new DiscoveredWebsocketEndpoints(result); } websocketEndpointsLookupFuture.setResult(endpointsResult); LOGGER.info("endpoint result is computed"); <START> }); <END> futures.add(websocketEndpointsLookupFuture); if (moduleDescriptor.isUsingHttps()) { throw new IllegalArgumentException("Cannot handle secure-http/https yet"); } return futures; }</code><technical_language>http work (more less) out of box</technical_language>

Target:
protected List<SmackFuture<LookupConnectionEndpointsResult, Exception>> lookupConnectionEndpoints() { assert discoveredWebsocketEndpoints == null; InternalSmackFuture<LookupConnectionEndpointsResult, Exception> websocketEndpointsLookupFuture = new InternalSmackFuture<>(); connectionInternal.asyncGo(() -> { WebsocketRemoteConnectionEndpoint providedEndpoint = null; URI uri = moduleDescriptor.getExplicitlyProvidedUri(); if (uri != null) { providedEndpoint = new WebsocketRemoteConnectionEndpoint(uri); } if (!moduleDescriptor.isWebsocketEndpointDiscoveryEnabled()) { assert providedEndpoint != null; SecurityMode mode = connectionInternal.connection.getConfiguration().getSecurityMode(); if ((providedEndpoint.isSecureEndpoint() && mode.equals(SecurityMode.disabled)) || (!providedEndpoint.isSecureEndpoint() && mode.equals(SecurityMode.required))) { throw new IllegalStateException("Explicitly configured uri: " + providedEndpoint.getWebsocketEndpoint().toString() + " does not comply with the configured security mode: " + mode); } Result manualResult = new Result(Arrays.asList(providedEndpoint), null); LookupConnectionEndpointsResult endpointsResult = new DiscoveredWebsocketEndpoints(manualResult); websocketEndpointsLookupFuture.setResult(endpointsResult); } else { DomainBareJid host = connectionInternal.connection.getXMPPServiceDomain(); ModularXmppClientToServerConnectionConfiguration configuration = connectionInternal.connection.getConfiguration(); SecurityMode mode = configuration.getSecurityMode(); Result xep0156result = WebsocketRemoteConnectionEndpointLookup.lookup(host, mode); List<WebsocketRemoteConnectionEndpoint> discoveredEndpoints = xep0156result.discoveredRemoteConnectionEndpoints; Result finalResult = new Result(discoveredEndpoints, xep0156result.getLookupFailures()); LookupConnectionEndpointsResult endpointsResult = new DiscoveredWebsocketEndpoints(finalResult); websocketEndpointsLookupFuture.setResult(endpointsResult); } }); return Collections.singletonList(websocketEndpointsLookupFuture); }