I’m trying to build a HTML5 “Server Send Event” with several clients.
In the mean time, I found out, that Nginx has to hold the client connection open, if currently no new data available to send to the client.
But I dont know how to handle it!
What is necessary to tell nginx to hold the connection open?
How can I use the open connections, when new data are available?
Hi @route443, I want send the messages to push via PHP.
I’m sorry, but by knowledge about that is not good! I haven’t a good explainasion about how Symfony works together with Mercure. My current understanding is only that Mercure is a hub and clients only connect the hub and the holds the connections open.
Synfony sends the new message to the hub and the hub send it to all open connections.
I have a PHP script which knows, when new data are avaiable.
Where I have to install Mercure?
If I install Mercure, how can I define the url and the port, and is a different port neccessary?
My Synfony project I have stored under /var/www/html/sseUpdate.
So I think. the first step should be to install the hub and get the clients to the hub.
The next step to setup the Symfony project to controll the hub und last to send new data to Synfony.
That is only my guess!
What are found are only examples and not a good explanation, how the different parts working together.
Maybe you could advice me a good documentation.
For one example I could get running curl -N -v localhost/api/stream/stock/AAPL , but if I use `localhost/api/stream/stock/AAPL` in the local browser, I only get a white screen. I think that is due the fact, I have setup Nginx in the right way. But I can’t find where /api/stream/stock/AAPL is located.