Add browser part to README
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
A simple SSE (Server Sent Event) Server written in Python
|
A simple SSE (Server Sent Event) Server written in Python
|
||||||
|
|
||||||
|
## Server
|
||||||
|
|
||||||
To test run
|
To test run
|
||||||
```
|
```
|
||||||
python3 SimpleSseSever.py
|
python3 SimpleSseSever.py
|
||||||
@@ -11,3 +13,16 @@ There is a requirements.txt, so you can install all dependicies:
|
|||||||
```
|
```
|
||||||
pip install -r requirements.txt
|
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)})
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user