Join the Mozilla’s Test Days event from 9–15 Jan to test the new Firefox address bar on Firefox Beta 135 and get a chance to win Mozilla swag vouchers! 🎁

Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Mear ynfo

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

Handling event streams

  • 1 antwurd
  • 1 hat dit probleem
  • 40 werjeftes
  • Lêste antwurd fan cor-el

more options

I am trying to get server sent event streams working.

As a test, I placed the following in a php file:

header('Content-Type: text/event-stream'); header('Cache-Control: no-cache'); // recommended to prevent caching of event data.

function sendMsg($msg) {

 echo "data: $msg" . PHP_EOL;
 echo PHP_EOL;
 flush();

}

sendMsg('server time: ' . date("h:i:s"));

When I load the page into FireFox (95.0.2 (64-bit)), it asks me if I want to save or open the file. Obviously it isn't handling the event stream properly (or my code is wrong)

I am trying to get server sent event streams working. As a test, I placed the following in a php file: header('Content-Type: text/event-stream'); header('Cache-Control: no-cache'); // recommended to prevent caching of event data. function sendMsg($msg) { echo "data: $msg" . PHP_EOL; echo PHP_EOL; flush(); } sendMsg('server time: ' . date("h:i:s")); When I load the page into FireFox (95.0.2 (64-bit)), it asks me if I want to save or open the file. Obviously it isn't handling the event stream properly (or my code is wrong)

Alle antwurden (1)

more options

Keazen oplossing