Constructor
new WebSocketServer(optionsopt, callbackopt)
- Source:
Creates an instance of WebSocketServer.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
||||||||||||||||||||||||||||||
callback |
function |
<optional> |
executed when the server is ready |
Members
connections
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
connections |
Object | dictionary of connected clients |
server
- Source:
- See:
Properties:
| Name | Type | Description |
|---|---|---|
server |
Object | instance |
Methods
close(callback)
- Source:
close the server
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
Object | callback when server has closed |
pub(namespace, data)
- Source:
Publish data to a given namespace
Parameters:
| Name | Type | Description |
|---|---|---|
namespace |
String | event namespace |
data |
any | the data to publish |
Events
close
- Source:
id of closed client
Type:
- String
connection
- Source:
id of connected client
Type:
- String
error
- Source:
error object from client disconnection (most likely)
Type:
- Object
reconnect
- Source:
id of reconnected client
Type:
- String