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: 11 months 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 (about 9 years ago)
- Default Branch: master
- Last Pushed: 2025-04-06T04:45:45.000Z (about 1 year ago)
- Last Synced: 2025-06-18T00:25:31.554Z (12 months ago)
- Topics: flyd, frp, node, promise, realtime, request, socket, socket-io, socketio, stream
- Language: JavaScript
- Homepage:
- Size: 168 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.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 dispatch = Dispatch(options)
/* port */
const dispatch = Dispatch({ port: 9000 })
/*
* httpServer instance
* for using inside working http server
* or with unix domain socket
*/
const dispatch = Dispatch({ server })
dispatch.on('name', handler)
dispatch.on({ name: handler })
function handler (data, endpoint) { /* … */ }
/*
* ws_uri: string with ws or ws+unix uri
*/
Endpoint(ws_uri)
/* websocket */
Endpoint('ws://127.0.0.1:9000')
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 © 2025, Strider.