Skip to content

75lb/sse-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

view on npm npm module downloads Gihub repo dependents Gihub package dependents Node.js CI js-standard-style

sse-server

Pipe an event stream from terminal to browser.

Synopsis

Launch the server.

$ sse-server
SSE server: http://localhost:9000
Input socket: localhost:9090

Pipe events to the input socket.

$ echo '{ "name": "something", "data": "one" }' | nc -c localhost 9090
$ echo '{ "name": "something", "data": "two" }' | nc -c localhost 9090

Connect a browser to the SSE server to consume the server-sent events.

$ curl http://localhost:9000
event: something
data: "one"

event: something
data: "two"

© 2018-22 Lloyd Brookes <75pound@gmail.com>.

About

Push an event stream from terminal to browser

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published