How to get SSE Last Event ID with CGI + Python -


i using server sent events (sse) push data front end. able implement of researching rfc https://www.w3.org/tr/2011/wd-eventsource-20111020/. part i'm stuck on if sse reconnects faulty connection.

the documentation says when sse connection reconnects adds last-event-id header data. have no idea how script.

i using lighttpd web server, cgi run scripts, , python 2.7 scripting language.

i attempted read os.environ, not contain related sse last received id.

does know how can last event id received?

i ended figuring out, useful in future. lasteventid used silently in of protocol. so, if connection drops temporarily , reconnects lasteventid used. sses missed queued up, , ones greater lasteventid sent. however, if connection permanently drops, or drops longer x minutes (browser dependent) sse connection terminated. lasteventid not sent because considered new connection.

i able around appending lasteventid request of sse. so...

/var/www/sse.py?lasteventid=100 

Comments