JavaScript EventSource SSE not firing in browser

前端 未结 3 1327
不知归路
不知归路 2020-12-05 13:49

I have been developing a nodejs server to provide server-side-events for a new website I am developing in HTML5.

When I telnet to the server it works correctly, send

3条回答
  •  猫巷女王i
    2020-12-05 14:26

    cracked it! :)

    Thanks to some help from Tom Kersten who helped me with testing. Turns out the code isnt the problem.

    Be warned.. if your client uses any kind of anti-virus software which intercepts web requests, it may cause problems here. In this case, Sophos Endpoint Security, which provides enterprise grade anti-virus and firewall protection has a feature called web protection. Within this features is an option to scan downloads; it seems that the SSE connection is treated as a download and thus not released to the browser until the connection is closed and the stream received to scan. Disabling this option cures the problem. I have submitted a bug report but other anti-virus systems may do the same.

    thanks for your suggestions and help everyone :)

提交回复
热议问题