stetson

Crates.iostetson
lib.rsstetson
version0.1.1
sourcesrc
created_at2023-03-30 00:26:52.900194
updated_at2023-03-30 02:43:50.509606
descriptionA pure rust pubsub server over HTTP websockets.
homepage
repositoryhttps://github.com/hexcowboy/stetson
max_upload_size
id824536
size57,548
hexcowboy (hexcowboy)

documentation

README

Stetson

Stetson is a pure rust pubsub server over HTTP websockets.

Use it vanilla or fork it and make your own modifications.

Crates.io

Usage

Install the binary

cargo install stetson

Run the server, making sure to set a publisher key

echo "PUBLISH_KEY=$(openssl rand -hex 24)" > .env ; stetson

You can find the publisher key that was generated in the previous step in the .env file

cat .env

Requests

subscribe

{ "subscribe": { "topics": ["sports", "weather"] } }

unsubscribe

{ "unsubscribe": { "topics": ["sports"] } }

publish

{ "publish": { "topics": ["weather"], "message": "storms ahead", "key": "..." } }

Responses

message - received when a new message from a subscribed topic is received

{ "message": { "topic": "weather", "message": "storms ahead" } }

error - received when there was en error publishing a message

{ "error": { "message": "some error message here" } }

License

Licensed under either of

Commit count: 125

cargo fmt