UNPKG

1.15 kBMarkdownView Raw
1## eventric Socket.IO remote endpoint [![Build Status](https://travis-ci.org/efacilitation/eventric-remote-socketio-endpoint.svg?branch=master)](https://travis-ci.org/efacilitation/eventric-remote-socketio-endpoint)
2
3This module is a Socket.IO/Websocket based adapter for the eventric remote endpoint interface.
4Use it in combination with
5[eventric-remote-socketio-client](https://github.com/efacilitation/eventric-remote-socketio-client)
6in order to communicate with remote contexts via Websockets (client to server and server to server).
7
8
9### API
10
11#### initialize(options, callback)
12
13Initializes the endpoint and calls the given callback when the initialization is finished.
14Two optional options may be passed into the function:
15
161. `ioInstance`: an instance of a Socket.IO server; if not given, a new one will be spawned automatically
172. `rpcRequestMiddleware(rpcRequest, socket)`: a middleware function for processing rpc requests;
18the function must return a Promise which can reject in order to cancel the RPC request
19
20Note: The middleware can be used to enrich data of RPC requests or to perform some kind of access control / authorization.
\No newline at end of file