SSE client in Pinia store and Vue3

BTW I don’t see any issue when I try to load your web page:

This is interesting… :thinking:
I have the issue with Chrome / Firefox and I removed all extensions in the browser.

I accessed a server via remote desktop
and I can confirm it is working OK for both Chrome and Firefox (server is also located in Sydney)

So it must be my computer

1 Like

My guess is that something is terminating the long connection when accessed from your network, does the /event-stream connection stay open if you open it from your browser directly?

Hello

When called from the browser, the /event-stream connection stops after 30sec-1min like when called from the app

I cannot find the issue… I stopped everything possible on my computer including anti-virus… it is a standalone computer (not company network) and I even try getting internet from my phone as a hotspot

I revert all the code and I can confirm that “SSE client in Pinia + Vue 3” are working well
(I tried from a remote computer)
It just does not work from my computer :slight_smile:

Thank you for your support and sorry to have involved you with this.

1 Like

I read a be more on SSE
“Network proxies and other hardware/software can totally break SSE”

Maybe there is something between my computer and the server

The server is nginx with the configuration following your recommendations
https://docs.servicestack.net/deploy-netcore-to-amazon-linux-2-ami#etc-nginx-conf-d-my-app-org-conf
also tried adding these

proxy_set_header Connection ''; 
chunked_transfer_encoding off;

Then we have this article

He is suggesting to what you have done in the app-server response headers
But he is also (and other people also do) suggesting this one.
Have you seen this?

X-Accel-Buffering: no;

I’ve not heard of it before but I’ve just added it as response header for the SSE /event-stream in this commit.

You can also add it to your SSE with:

Plugins.Add(new ServerEventsFeature {
    OnInit = req => req.Response.AddHeader("X-Accel-Buffering","no")
});

Thank you very much. No change but it is probably good to have :slight_smile:

For info, I found that one of my other project with a very similar (if not identical) code and hosting set-up is actually working.

See the bottom one is working… so there is hope
I think the code is the same. Checking DNS, difference in server configuration… :slight_smile: