Constructor #
Use this constructor to create a new instance of the SocketIO
protocol with specific options.
Arguments #
SocketIO(host, [options]);
Argument | Type | Description |
---|---|---|
host | string | Kuzzle server hostname or IP |
options | object | SocketIO connection options |
options #
SocketIO protocol connection options.
Property | Type (default) | Description |
---|---|---|
port | number ( 7512 ) | Kuzzle server port |
sslConnection | boolean ( false ) | Use SSL to connect to Kuzzle server |
autoReconnect | boolean ( true ) | Automatically reconnect to kuzzle after a disconnected event |
reconnectionDelay | number ( 1000 ) | Number of milliseconds between reconnection attempts |
Return #
A SocketIO
protocol instance.
Usage #
// Loads the SocketIO protocol
const
{
Kuzzle,
SocketIO
} = require('kuzzle-sdk');
const options = {
autoReconnect: false
};
// Instantiates the SocketIO protocol
const socketIOProtocol = new SocketIO('kuzzle', options);
// Use it with Kuzzle
const kuzzle = new Kuzzle(socketIOProtocol);
Edit this page on Github(opens new window)