Class WebSocketConnectionConfiguration

  • All Implemented Interfaces:
    ConnectionConfiguration

    public final class WebSocketConnectionConfiguration
    extends ClientConnectionConfiguration
    A configuration for a WebSocket connection.

    It allows you to configure basic connection settings like hostname and port, as well as the path in the WebSocket URI.

    Usage

    In order to create an instance of this class you have to use the builder pattern as shown below.

    
     WebSocketConnectionConfiguration connectionConfiguration = WebSocketConnectionConfiguration.builder()
        .hostname("localhost")
        .port(7443)
        .path("/ws/")
        .sslContext(sslContext)
        .channelEncryption(ChannelEncryption.DIRECT)
        .connector(new JdkWebSocketConnector())
        .build();
     

    The above sample configuration will connect to wss://localhost:7443/ws/ using SSL with a custom SSLContext.

    This class is immutable.

    Since:
    0.7.0
    See Also:
    XMPP Subprotocol for WebSocket