Crates.io | postsse |
lib.rs | postsse |
version | 0.1.0 |
source | src |
created_at | 2022-10-24 22:12:30.317341 |
updated_at | 2022-10-24 22:12:30.317341 |
description | Simple HTTP server that lets subsribe for data with GET requests (as text/event-stream SSE) and emit data with POST requests |
homepage | |
repository | https://github.com/vi/postsse |
max_upload_size | |
id | 696321 |
size | 26,520 |
HTTP POST and Server-sent events interconnector, allowing simple publish-subsribe scheme using GET and POST requests.
This is intended to be used as a building block, especially during development or prototyping.
Download pre-built executables from Github releases, install it from source code with cargo install --path .
or from crates.io with cargo install postsse
.
$ postsse 127.0.0.1:1234
$ curl -v http://127.0.0.1:1234/
* Trying 127.0.0.1:1234...
* Connected to 127.0.0.1 (127.0.0.1) port 1234 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:1234
> User-Agent: curl/7.74.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< content-type: text/event-stream
< access-control-allow-origin: *
< transfer-encoding: chunked
< date: Mon, 24 Oct 2022 21:58:36 GMT
<
data: 123 | $ curl http://127.0.0.1:1234/ -d 123
|
data: qwerty | $ curl http://127.0.0.1:1234/ -d qwerty
|
data: ABC | $ curl http://127.0.0.1:1234/ \
data: DEF | --data-binary $'ABC\nDEF\n'