Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/streetstrider/booth
Booth provides symmetric Event API over websocket or unix domain socket
https://github.com/streetstrider/booth
flyd frp node promise realtime request socket socket-io socketio stream
Last synced: 7 days ago
JSON representation
Booth provides symmetric Event API over websocket or unix domain socket
- Host: GitHub
- URL: https://github.com/streetstrider/booth
- Owner: StreetStrider
- License: other
- Created: 2017-03-07T20:34:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-24T05:02:02.000Z (about 2 months ago)
- Last Synced: 2024-10-13T10:53:40.862Z (about 1 month ago)
- Topics: flyd, frp, node, promise, realtime, request, socket, socket-io, socketio, stream
- Language: JavaScript
- Homepage:
- Size: 164 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# booth
> Booth provides symmetric Event API over websocket or unix domain socket
Alike socket.io, but less powerful. Simple Event API, simple reconnect strategy,
symmetric usage via `Endpoint()` on both client and server sides.# api
```js
/*
* options: WebSocket.Server options
*/
const booth = Booth(options)/* port */
const booth = Booth({ port: 9000 })/*
* httpServer instance
* for using inside working http server
* or with unix domain socket
*/
const booth = Booth({ server })booth.on('name', handler)
booth.on({ name: handler })function handler (data, endpoint) { /* … */ }
/*
* ws_uri: string with ws or ws+unix uri
*/
Endpoint(ws_uri)/* websocket */
Endpoint('ws://localhost:9000')/* unix domain socket */
Endpoint('ws+unix:///tmp/booth/unix.sock')endpoint.on('name', handler)
endpoint.on({ name: handler })function handler (data, endpoint) { /* … */ }
```# license
ISC.
Copyright © 2022, Strider.