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
I'm trying to implement single connection close detection for server-sent event streams using Hijack but am currently facing the following challenges:
when HijackSetNoResponse is true, the connection close detection works fine but events are NOT sent to the client.
when HijackSetNoResponse is false(default), the connection close detection DOESN'T work but events are successfully sent to the client.
So how can I get both single connection close detection and sending events to the client to work together simultaneously? any help is highly appreciated
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord
@Tibz-Dankan The issue occurs because HijackSetNoResponse(true) prevents fasthttp from sending HTTP headers automatically while allowing connection close detection, but SSE requires proper HTTP headers to work. When it's set to false, headers are sent correctly but connection close detection doesn't work. This creates a conflict between these two requirements. A solution would be to manually send the HTTP headers after setting HijackSetNoResponse(true), thus achieving both connection close detection and proper SSE functionality. I'll try to submit a PR that provides a simple SSE helper function to handle this automatically. What do you think? @ReneWerner87@efectn@gaby
Question Description
I'm trying to implement single connection close detection for server-sent event streams using Hijack but am currently facing the following challenges:
HijackSetNoResponse
is true, the connection close detection works fine but events are NOT sent to the client.HijackSetNoResponse
is false(default), the connection close detection DOESN'T work but events are successfully sent to the client.So how can I get both
single connection close detection
andsending events to the client
to work together simultaneously? any help is highly appreciatedI have provided minimal reproducible code below.
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: