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 |
|
3 | This module is a Socket.IO/Websocket based adapter for the eventric remote endpoint interface.
|
4 | Use it in combination with
|
5 | [eventric-remote-socketio-client](https://github.com/efacilitation/eventric-remote-socketio-client)
|
6 | in 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 |
|
13 | Initializes the endpoint and calls the given callback when the initialization is finished.
|
14 | Two optional options may be passed into the function:
|
15 |
|
16 | 1. `ioInstance`: an instance of a Socket.IO server; if not given, a new one will be spawned automatically
|
17 | 2. `rpcRequestMiddleware(rpcRequest, socket)`: a middleware function for processing rpc requests;
|
18 | the function must return a Promise which can reject in order to cancel the RPC request
|
19 |
|
20 | Note: 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 |