You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will allow more control over the behavior of the SSE connection. For instance, I want to implement the fix for this firefox bug where I need to have access to the EventSource object for this to be implemented. This will also fix several issues:
Another advantage is to be able to add event listeners outside of htmx context.
Also, the number of connections is limited to only 6 when not used in HTTP2, so it would be beneficial to reused an existing connection across multiple independent elements.
Warning: When not used over HTTP/2, SSE suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple tabs, as the limit is per browser and is set to a very low number (6). The issue has been marked as "Won't fix" in Chrome and Firefox. This limit is per browser + domain, which means that you can open 6 SSE connections across all of the tabs to www.example1.com and another 6 SSE connections to www.example2.com (per Stack Overflow). When using HTTP/2, the maximum number of simultaneous HTTP streams is negotiated between the server and the client (defaults to 100).
The text was updated successfully, but these errors were encountered:
// set a function in the public API for creating new EventSource objects
if(htmx.createEventSource==undefined){
htmx.createEventSource=createEventSource
}
So, you could already override htmx.createEventSource with a function of your own, you simply need to make sure that your code executes before the SSE extension initializes
This will allow more control over the behavior of the SSE connection. For instance, I want to implement the fix for this firefox bug where I need to have access to the
EventSource
object for this to be implemented. This will also fix several issues:Another advantage is to be able to add event listeners outside of
htmx
context.Also, the number of connections is limited to only 6 when not used in
HTTP2
, so it would be beneficial to reused an existing connection across multiple independent elements.The text was updated successfully, but these errors were encountered: