WebsocketClientPlugin
Extends:
Constructor Summary
Public Constructor | ||
public |
constructor(options: object) Create an OSC WebsocketClientPlugin instance with given options. |
Member Summary
Private Members | ||
private |
|
|
private |
|
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
close() Close Websocket |
|
public |
Connect to a Websocket server. |
|
public |
send(binary: Uint8Array) Send an OSC Packet, Bundle or Message to Websocket server |
|
public |
Returns the current status of the connection |
Private Methods | ||
private |
registerNotify(fn: function) Internal method to hook into osc library's EventHandler notify method |
Inherited Summary
From class Plugin | ||
public |
close() Close socket connection and anything else used in the implementation. |
|
public |
Open socket connection. |
|
public |
send(binary: Uint8Array, customOptions: object) Send an OSC Packet, Bundle or Message. |
|
public |
Returns the current status of the connection |
Public Constructors
public constructor(options: object) source
Create an OSC WebsocketClientPlugin instance with given options. Defaults to localhost:8080 for connecting to a Websocket server
Override:
Plugin#constructorParams:
Name | Type | Attribute | Description |
options | object |
|
Custom options |
options.host | string |
|
Hostname of Websocket server |
options.port | number |
|
Port of Websocket server |
options.secure | boolean |
|
Use wss:// for secure connections |
options.protocol | string | string[] |
|
Subprotocol of Websocket server |
Example:
const plugin = new OSC.WebsocketClientPlugin({ port: 9912 })
const osc = new OSC({ plugin: plugin })
Private Members
Public Methods
public open(customOptions: object) source
Connect to a Websocket server. Defaults to global options
Override:
Plugin#openParams:
Name | Type | Attribute | Description |
customOptions | object |
|
Custom options |
customOptions.host | string |
|
Hostname of Websocket server |
customOptions.port | number |
|
Port of Websocket server |
customOptions.secure | boolean |
|
Use wss:// for secure connections |
options.protocol | string | string[] |
|
Subprotocol of Websocket server |
public send(binary: Uint8Array) source
Send an OSC Packet, Bundle or Message to Websocket server
Override:
Plugin#sendParams:
Name | Type | Attribute | Description |
binary | Uint8Array | Binary representation of OSC Packet |