Re: Server-Sent Events

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu