Replies: 1 comment 1 reply
-
|
@cl3mcg thanks! Could you please do a PR with these changes? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I noticed a specific comment in the
server.gofile that explains why theReadTimeoutandWriteTimeoutkeys in theServerstruct are set to 5 and 10 seconds, respectively. While this configuration is generally useful, it can interfere with Server-Sent Events (SSE) or WebSocket (WS) connections.With the current setup, it is challenging to properly establish SSE or WS connections in the Go server because the connection resets after 10 seconds due to the
WriteTimeoutsetting.It is unclear how the
ReadTimeoutsetting interfere with the SSE or WS connections, but this also has an undesirable effect as multiple "connection reset" errors are displayed in the web browser console.To address this, I suggest adding further comments in the
server.gofile to explain that if SSE or WS need to be set up, it would be necessary to comment out or remove theReadTimeoutandWriteTimeoutkeys and their respective values.Here is the updated code snippet with the additional comments:
server.goThis additional context should help other developers understand the implications of the timeout settings and adjust them as needed for SSE or WS connections.
As I have a limited understanding of this specific configuration, if anyone has a better idea or another way to set up properly working SSE or WS connections without altering the
ReadTimeoutandWriteTimeoutkeys in theServerstruct, please feel free to share it.Thank you for your attention to this matter.
Best regards,
Beta Was this translation helpful? Give feedback.
All reactions