0.5.12 • Published 9 years ago
origami2-client-io v0.5.12
Origami client socket.io helper
constructor
Params:
privateKeyrequired: private key to encrypt the communication with
.createFactorySocket
Returns: a promise to be resolved with a factory object or to be rejected. The factory object takes a token parameter to use with the client. Params:
socketrequired: a socket object throgh to which establish the communication with.
Please note that the socket will use several layers. The other end is supposed to be using the stack socket.io helper
.listenSocket
Returns: a promise to be resolved with a API client or to be rejected. Params:
socketrequired: a socket object throgh to which establish the communication with.tokenoptional: the token to use with the client
.connect
Returns: a promise to be resolved with a API client or to be rejected. Params:
urlrequired: the url to which to connect to using socket.iotokenoptional: the token to use with the client