Synapse is a private WebSocket relay server with peer discovery, broadcasting & direct messaging between peers and message filtering via topics.
The server protocol and implementation are designed to be application agnostic, however the use case within Headbase is allowing different devices (peers) to connect and synchronization data.
Caution
This project is not yet stable and the specification and implementation may change drastically between any v0.x.x version.
Features:
- Authentication via static secret (hopefully changing to public/private key in future).
- No "global" or "public" relay, peers share their own private relay. (currently via arbitrary id, hopefully via public key in future as per above).
- Lightweight message protocol to ensure peer compatibility.
- Peer discovery mechanism.
- Broadcast and direct messaging supported between peers.
- Message topics allow peers to request a filtered subset of broadcast messages.
Docker is the only supported way of running a relay in production. You can learn more at docs/user/self-hosting.md.
- Node.js and NPM (LTS)
- Docker (if testing docker builds)
- Install dependencies:
npm install
- Configure environment variables (if desired, the server has defaults it will use):
cp .env.example .env
- Run the app in dev mode:
npm start
- Run tests:
npm run tests
- Run a build:
npm run build
- Run the build:
npm run start:build
This project is currently open source, not open contribution. This is a personal project in its early stages. You're welcome to try it out, ask questions, raise bug reports etc but it wouldn't be practical to accept external code contributions or feature requests yet.
I'm open to this changing in the future once the project is more stable, collaboration is one of the great things about open source after all!
Headbase projects are released under the GNU AGPLv3 licence.