Open qknight opened 1 year ago
ps: have you tried to use the gorilla library, or something more recent? I think that net module is not super supported and legacy.
In pankat I use these libraries:
"github.com/gocraft/web"
"golang.org/x/net/websocket"
"net/http"
Maybe I should have tried a more recent implementation. For me it works right now but on the next iteration I keep this in mind.
I've added this issue in case someone gets down the same rabbit hole.
https://github.com/gorilla development has stalled also.
I’ve used this one last year -> github.com/gobwas/ws
I remember when the gorilla maintainer said he was stepping down, so yeah it must have stalled.
On Apr 7, 2023, at 2:42 AM, Joachim Schiele @.***> wrote:
https://github.com/gorilla development has stalled also.
— Reply to this email directly, view it on GitHub https://github.com/machinezone/IXWebSocket/issues/451#issuecomment-1500125370, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2O6UOAHUD6ECQT5RGU24TW77OPNANCNFSM6AAAAAAV3TDN5M. You are receiving this because you commented.
https://github.com/gobwas/ws maybe I'll give this a try this week.
Problem
The default implementation of stop() sends this data, which can be seen in wireshark:
0000 03 e8 4e 6f 72 6d 61 6c 20 63 6c 6f 73 75 72 65 ..Normal closure
This confused my go application because it received a message with the contents:
/R"<\n
And it was quite hard to debug. I'm not sure if this is a bug at all. It seems that golang.org/x/net/websocket interpretes the reason as a normal message but instead of the text
I see
with \n being a newline.
Solution
m_webSocket->stop(ix::WebSocketCloseConstants::kNormalClosureCode, "");
Detailed problem & solution
default stop code confused my application
Adaption to the stop call