28
Views
2
Comments
Solved
[SSE Traditional Client] SSE Connection aborts
sse-traditional-client
Web icon
Forge asset by Nuno Damaso
Application Type
Traditional Web

Hi Nuno

I was unable to find a Traditional Web example for SSE.  So I have copied across the Reactive Web Chat example into a Traditional web app and used the EventSource block from SSE_Traditional_Lib.  

However the EventSource Block from SSE_Traditional_Lib returns the following error in the browser console:

"EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection."

I have attached my oml with the hub and client.

Any guidance/suggestions would be welcome.

I would really like to get this working in a Traditional web app to monitor and return the process states of files as they are being processed etc...  

Thanks 

Charles

SSE_Chat.oap
2024-09-08 11-13-40
Nuno Damaso
 
MVP
Solution

Hi Charles,

Regarding the Traditional Web Example, if you go to Forge on your Service Studio, you will find an "Install Demo" Link. Here's a screenshot of an already installed demo:



Regarding your .oap, there are a few things you need to fix:

- Your send need to be an Ajax Submit

- You need to populate the Subscribe URL on the component:

- You need to point to the correct static entity endpoint url, you were pointing to a demo one:

- You need to Ajax Refresh your chat area:


Please see the attachment with the above.

I would highly recommend that you try to download or install the Traditional Demo.


Thanks 

SSE_Chat_fix.oap
UserImage.jpg
Charles Hewitt

All works nicely thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.