SDK
SDK Java v3.x
2

# Constructor

Initializes a new instance of the WebSocket class pointing to the Kuzzle server specified by the uri.

# Arguments

Copied to clipboard!
public WebSocket(URI uri, WebSocketOptions options) throws URISyntaxException, IllegalArgumentException

Argument Type Description
uri
Uri
URI pointing to a Kuzzle server
options
WebSocketOptions
Class which contains websocket options

# uri

A Uri object pointing to a Kuzzle server.

Use wss://<host>:<ip> to initiate a secure SSL connection.

# options

The options used to connect to the Kuzzle instance. WebSocketOptions

# Return

A WebSocket protocol instance.

# Arguments

Copied to clipboard!
public WebSocket(String host, WebSocketOptions options) 
  throws URISyntaxException, IllegalArgumentException

Argument Type Description
host
String
Host pointing to a Kuzzle server
options
WebSocketOptions
Class which contains websocket options

# host

A host pointing to a Kuzzle server.

Use wss://<host>:<ip> to initiate a secure SSL connection.

# options

The options used to connect to the Kuzzle instance. WebSocketOptions

# Return

A WebSocket protocol instance.

# Usage

Copied to clipboard!
WebSocketOptions options = new WebSocketOptions();
options.setAutoReconnect(true)
  .setConnectionTimeout(42000)
  .setPort(7513)
  .setSsl(false);
WebSocket ws = new WebSocket("localhost", options);