|
6 | 6 |
|
7 | 7 | A main goal of this project is to have the JSON-RPC server and client support __bidirectional JSON-RPC requests over a single WebSocket connection.__ Simply put, it makes it possible to have a JSONRPC __Server__ in the browser and a separate one in the back-end. |
8 | 8 |
|
9 | | -This library is tested in __browsers__ (at least Internet Explorer 10) and in __Node.js__ (at least 7.8, or 7.x with the --harmony flag.). |
| 9 | +This library is tested in __browsers__ (>= IE10) and in __Node.js__ (>=7.8). |
| 10 | + |
| 11 | + |
| 12 | +## Transports |
10 | 13 |
|
11 | 14 | Both the server and client support two __transports, HTTP and WebSocket__, and allow more through plugin extensibility. |
12 | 15 |
|
13 | | -__Any WebSocket implementation may be used__, handling of the HTTP server and WebSocket is external to these JSONRPC classes. |
| 16 | +#### WebSocket |
| 17 | + |
| 18 | +__Any WebSocket implementation may be used__, as handling of the HTTP server and WebSocket is external to these JSONRPC classes. |
| 19 | + |
| 20 | +For WebSocket client support in Node.js and browsers, `JSONRPC.Plugins.Client.WebSocketTransport` accepts connected W3C compatible WebSocket class instances (out of the box browser [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) and Node.js [websockets/ws](https://github.com/websockets/ws) `WebSocket`). |
| 21 | + |
| 22 | +On the Node.js side, this library is tested to work with [websockets/ws](https://github.com/websockets/ws). Other `WebSocketServer` implementations are supported if API compatible with `websockets/ws` (constructor and events), or made compatible through an adapter. |
| 23 | + |
| 24 | +#### HTTP |
| 25 | + |
| 26 | +`JSONRPC.Client` has embeded support for HTTP requests, through [fetch](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) (polyfills for older browsers exist, and work just fine). |
| 27 | + |
| 28 | +#### Other |
14 | 29 |
|
15 | | -For WebSocket client support, it expects W3C compatible WebSocket class instances (out of the box browser `WebSocket` and Node.js [websockets/ws](https://github.com/websockets/ws) `WebSocket`). |
| 30 | +It is easy to support other transports, see `JSONRPC.Plugins.Client.WebSocketTransport` for an example. |
16 | 31 |
|
17 | | -On the Node.js side it is tested to work with [websockets/ws](https://github.com/websockets/ws). Other `WebSocketServer` implementations are supported if API compatible with `websockets/ws` (constructor and events), or made compatible through an adapter. |
| 32 | +## Events and plugins |
18 | 33 |
|
19 | 34 | Plugins are allowed to replace the JSON-RPC protocol altogether, extend the protocol or wrap it. |
20 | 35 |
|
|
0 commit comments