README
socket.io-bridge-client
Client implementation for socket.io-bridge.
Please find the project documentation at https://github.com/michaelfranzl/socket.io-bridge .
API Reference
Classes
Typedefs
BridgeClient
Kind: global class
- BridgeClient
- new BridgeClient(opts)
- static
- .make(opts) ⇒
Promise
- .make(opts) ⇒
- inner
- ~onconnection :
function
- ~onconnection :
new BridgeClient(opts)
Param | Type |
---|---|
opts | Object |
opts.socket | Socket |
Promise
BridgeClient.make(opts) ⇒ Make a Socket.IO bridge to another client.
Kind: static method of BridgeClient
Returns: Promise
- - Promise resolving with a Socket.IO client socket connecting to the
requested peer/client. The Promise can be used only for a single connection, e.g. when peerUid
is set and there will be no incoming connections.
Param | Type | Default | Description |
---|---|---|---|
opts | Object |
||
[opts.uid] | string |
"globally unique" |
Our ID. |
[opts.peerUid] | string |
The ID of the peer we want to establish a connection to. | |
[opts.onconnection] | onconnection |
Called for each incoming connection. | |
[opts.logger] | object |
No logging by default |
function
BridgeClient~onconnection : Called as soon as the peer identified by peerUid is available for a connection.
Kind: inner typedef of BridgeClient
Param | Type | Description |
---|---|---|
socket | Socket |
Socket.IO client socket connecting to the requested peer/client. |
Socket
Kind: global typedef
See: https://github.com/socketio/socket.io-client/blob/master/docs/API.md#socket