API - socketCluster (Client)
This is the root standalone object for the SocketCluster client library - You can use it to create socket connections which you can use to interact with the server in real-time.
Properties:
version | The SC client version number. |
clients | An object which holds all current SC clients/sockets. |
Methods:
create([options]) |
This method was called connect before socketcluster-client v10.0.0.
Creates and returns a new socket connection to the specified host (or origin if not
specified). The options argument is optional - If omitted, the socket
will try to connect to the origin server on the current port. For cross
domain requests, a typical options object might look like this (example over HTTPS/WSS):
```js
{
hostname: 'securedomain.com',
secure: true,
port: 443,
rejectUnauthorized: false // Only necessary during debug if using a self-signed certificate
}
```
|
listen(port, options, fn) | Create a SocketCluster server instance which is already attached to an HTTP server instance and ready to use. |