https://github.com/fortunejs/fortune-ws
WebSocket server and client for Fortune.js.
https://github.com/fortunejs/fortune-ws
websockets
Last synced: 3 months ago
JSON representation
WebSocket server and client for Fortune.js.
- Host: GitHub
- URL: https://github.com/fortunejs/fortune-ws
- Owner: fortunejs
- License: mit
- Created: 2016-10-18T13:53:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-28T02:37:21.000Z (almost 7 years ago)
- Last Synced: 2025-04-06T14:41:36.335Z (3 months ago)
- Topics: websockets
- Language: JavaScript
- Size: 46.9 KB
- Stars: 3
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fortune WebSocket
[](https://travis-ci.org/fortunejs/fortune-ws)
[](https://www.npmjs.com/package/fortune-ws)
[](https://raw.githubusercontent.com/fortunejs/fortune-ws/master/LICENSE)This is a WebSocket implementation for Fortune.js, which implements a wire protocol based on MessagePack.
```sh
$ npm install fortune-ws --save
```## Usage
Consult the [source code](https://github.com/fortunejs/fortune-ws/tree/master/lib) or the [documentation website](http://fortune.js.org/api) for more information.
```js
const fortuneWS = require('fortune-ws')// Pass in a Fortune instance and an optional change function,
// options object, and connection callback.
const server = fortuneWS(instance, change, options, callback)// There is also a client request function.
const promise = fortuneWS.request(client, options, state)// Automatically syncing client, given a Fortune instance.
const listener = fortuneWS.sync(client, instance)
```The browser version includes the client implementations but not the server.
## License
This software is licensed under the [MIT license](https://raw.githubusercontent.com/fortunejs/fortune-ws/master/LICENSE).