I have some problems on SseEmitter too, So i try to use your code to fix my problems, but the problems exist too. I use curl to request,
curl -v -H "Accept: text/event-stream" \
http://localhost:8181/sse/events
the response is
Trying 127.0.0.1:8181...
* Connected to localhost (127.0.0.1) port 8181 (#0)
> GET /sse/events HTTP/1.1
> Host: localhost:8181
> User-Agent: curl/8.1.2
> Accept: text/event-stream
>
< HTTP/1.1 200
< Vary: Origin
< Vary: Access-Control-Request-Method
< Vary: Access-Control-Request-Headers
< Content-Type: text/event-stream
< Content-Length: 26
< Date: Sun, 27 Apr 2025 10:56:32 GMT
<
event:myevent
* Connection #0 to host localhost left intact
data:Event 0
it just return first event, but in server log i can see the printing log , i am confused。is there anybody can help,please