A simple SSE (Server Sent Event) Server written in Python
Go to file
Markus Bauer 7f843b4ecd Add function to publish a message 2023-03-27 23:42:07 +02:00
src/server Add function to publish a message 2023-03-27 23:42:07 +02:00
.gitignore Add VS Code to gitignore 2021-05-15 17:54:36 +02:00
LICENSE Initial commit 2021-05-15 15:48:47 +00:00
README.md Add browser part to README 2021-05-18 17:47:41 +02:00
requirements.txt Update requirements.txt 2023-03-27 23:19:40 +02:00

README.md

Simple-SSE-Server

A simple SSE (Server Sent Event) Server written in Python

Server

To test run

python3 SimpleSseSever.py

There is a requirements.txt, so you can install all dependicies:

pip install -r requirements.txt

Browser

To check the connection in the browsser (Chrome, Firefox, etc.), you can open

http://127.0.0.1/stream

Ope the developer console, there you can register to the event

var src = new EventSource('http://127.0.0.1:5000/stream');
src.addEventListener("test", function(event) {
    console.log(event)})