Constructor
new WebSocketClient(optionsopt)
- Source:
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
options object Properties
|
Members
blacklist
- Source:
Properties:
Name | Type | Description |
---|---|---|
blacklistNamespaces |
String | array of namespaces that will be filtered out in pub() |
client
- Source:
- See:
Properties:
Name | Type | Description |
---|---|---|
WS |
Object | client |
closed
- Source:
Properties:
Name | Type | Description |
---|---|---|
connecting |
Boolean | client is closed |
closing
- Source:
Properties:
Name | Type | Description |
---|---|---|
connecting |
Boolean | client is closeing |
connecting
- Source:
Properties:
Name | Type | Description |
---|---|---|
connecting |
Boolean | client is connecting |
id
- Source:
Properties:
Name | Type | Description |
---|---|---|
id |
String | Current |
message
- Source:
Properties:
Name | Type | Description |
---|---|---|
message |
Message |
open
- Source:
Properties:
Name | Type | Description |
---|---|---|
connecting |
Boolean | client is open |
subscribed
- Source:
Properties:
Name | Type | Description |
---|---|---|
subscribed |
Array | Curret subscribed events. Defaults to |
uri
- Source:
Properties:
Name | Type | Description |
---|---|---|
uri |
String |
|
Methods
close() → {WebSocketClient}
- Source:
close the client connection
Returns:
- Type
- WebSocketClient
pub(namespace, payload, callbackopt) → {WebSocketClient}
- Source:
pub Publish a payload to a given event namespace
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
namespace |
String | delimited namespace to publish on |
||
payload |
Number | String | Object |
''
|
the payload object to publish |
|
callback |
function |
<optional> |
optional callback for message sent |
Returns:
- Type
- WebSocketClient
Events
close
- Source:
client has closed connection
connect
- Source:
client has received a connect event
Type:
- String
ready
- Source:
client has opened and is ready