SSE(EventSource): why no more than 6 connections?

后端 未结 3 1326
南方客
南方客 2020-12-05 19:50

I wanted to see how many simultaneous SSE (aka EventSource) connections I could setup, before overloading my machine. But testing with Firefox (Firefox 18 or Firefox 20) it

3条回答
  •  有刺的猬
    2020-12-05 20:28

    Referring this https://developer.mozilla.org/en-US/docs/Web/API/EventSource

    It is stated that Firefox and Chrome set the limit on the number of connections opened by a browser + domain.

    When not used over HTTP/2, SSE suffers from a limitation to the maximum number of open connections, which can be specially painful when opening various tabs as the limit is per browser and 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, so that 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. (from Stackoverflow). When using HTTP/2, the maximum number of simultaneous HTTP streams is negotiated between the server and the client (defaults to 100).

提交回复
热议问题