socket.io-bridge-client

1.0.0 • Public • Published

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

BridgeClient

Typedefs

Socket

BridgeClient

Kind: global class

new BridgeClient(opts)

Param Type
opts Object
opts.socket Socket

BridgeClient.make(opts) ⇒ Promise

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

BridgeClient~onconnection : function

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

Dependents (0)

Package Sidebar

Install

npm i socket.io-bridge-client

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

33.4 kB

Total Files

14

Last publish

Collaborators

  • michaelfranzl