mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-25 20:18:00 +01:00
Merge pull request #543 from guusdk/websocket-default-port
Websocket implicit discovery should use common ports
This commit is contained in:
commit
ae2c53f78c
1 changed files with 10 additions and 9 deletions
|
@ -223,15 +223,16 @@ public final class XmppWebSocketTransportModule
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moduleDescriptor.isImplicitWebSocketEndpointEnabled()) {
|
if (moduleDescriptor.isImplicitWebSocketEndpointEnabled()) {
|
||||||
String urlWithoutScheme = "://" + host + ":5443/ws";
|
for (final int securePort : new int[] {5443, 5281, 7443}) {
|
||||||
|
SecureWebSocketRemoteConnectionEndpoint implicitSecureEndpoint = SecureWebSocketRemoteConnectionEndpoint.from(
|
||||||
SecureWebSocketRemoteConnectionEndpoint implicitSecureEndpoint = SecureWebSocketRemoteConnectionEndpoint.from(
|
WebSocketRemoteConnectionEndpoint.SECURE_WEB_SOCKET_SCHEME + "://" + host + ":" + securePort + "/ws");
|
||||||
WebSocketRemoteConnectionEndpoint.SECURE_WEB_SOCKET_SCHEME + urlWithoutScheme);
|
result.discoveredSecureEndpoints.add(implicitSecureEndpoint);
|
||||||
result.discoveredSecureEndpoints.add(implicitSecureEndpoint);
|
}
|
||||||
|
for (final int insecurePort : new int[] {5443, 5280, 7070}) {
|
||||||
InsecureWebSocketRemoteConnectionEndpoint implicitInsecureEndpoint = InsecureWebSocketRemoteConnectionEndpoint.from(
|
InsecureWebSocketRemoteConnectionEndpoint implicitInsecureEndpoint = InsecureWebSocketRemoteConnectionEndpoint.from(
|
||||||
WebSocketRemoteConnectionEndpoint.INSECURE_WEB_SOCKET_SCHEME + urlWithoutScheme);
|
WebSocketRemoteConnectionEndpoint.INSECURE_WEB_SOCKET_SCHEME + "://" + host + ":" + insecurePort + "/ws");
|
||||||
result.discoveredInsecureEndpoints.add(implicitInsecureEndpoint);
|
result.discoveredInsecureEndpoints.add(implicitInsecureEndpoint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final LookupConnectionEndpointsResult endpointsResult;
|
final LookupConnectionEndpointsResult endpointsResult;
|
||||||
|
|
Loading…
Reference in a new issue