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
-
Hello everyone,
I noticed a specific comment in the
server.go
file that explains why theReadTimeout
andWriteTimeout
keys in theServer
struct 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
WriteTimeout
setting.It is unclear how the
ReadTimeout
setting 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.go
file to explain that if SSE or WS need to be set up, it would be necessary to comment out or remove theReadTimeout
andWriteTimeout
keys and their respective values.Here is the updated code snippet with the additional comments:
server.go
This 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
ReadTimeout
andWriteTimeout
keys in theServer
struct, 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