Re: Server-Sent Events
- Posted by jmduro May 09, 2017
- 3422 views
Problem seems to be the content-type. Following code does not the job as expected but executes (EU4.1 on Linux Debian 64):
include std/os.e include std/io.e puts(1,"Cache-Control: no-cache\n") puts(1, "Content-Type: text/plain\n\n") -- puts(1,"Content-Type: text/event-stream\n\n") for i = 1 to 100 do sleep(0.1) puts(1, sprintf("data: %d \n\n", i)) -- must have the two newlines flush(1) end for puts(1, "Status: 415 OK")
Jean-Marc