Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nickpegg/playground_server_sent_events
A playground for messing around with server-sent-events
https://github.com/nickpegg/playground_server_sent_events
Last synced: 17 days ago
JSON representation
A playground for messing around with server-sent-events
- Host: GitHub
- URL: https://github.com/nickpegg/playground_server_sent_events
- Owner: nickpegg
- Created: 2021-02-28T16:42:04.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-26T20:16:27.000Z (2 months ago)
- Last Synced: 2024-10-26T22:19:51.568Z (2 months ago)
- Language: Python
- Size: 156 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Server-Sent Events Playground
After reading [Julia Evans's blog post on server-sent
events](https://jvns.ca/blog/2021/01/12/day-36--server-sent-events-are-cool--and-a-fun-bug/),
I wanted to mess around with them! This is a little playground repo for that.## log_tailer
This is a simple program which has one thread writing lines to a log file, and
another thread serving up a Flask app which has a /read endpoint that will send
server-sent events of new logfile contents.The javascript here handles the events and appends the new lines to the
displayed log, and even has the option to auto-scroll the log like `tail -F`!To see this in action, run `make run` in a terminal and then open
https://localhost:5000/ in a web browser.