dpallot / simple-websocket-server

A python based websocket server that is simple and easy to use.
951 stars 319 forks source link

Connection auto close when using secure websocket #62

Closed Austaras closed 5 years ago

Austaras commented 6 years ago

Auto close when payload size > 1253 bytes

studio-indelebil commented 6 years ago

Hi,

I have the exact same problem when using SSL & sending "large" messages, between 1KB and 2KB, not always the same, depending on... who knows !

The client sends the "large" JSON and immediately receives a "close" event with error code=1006 and reason="" (this was perfectly working when using SimpleWebSocketServer, without SSL).

On the server side, the connection is closed without any exception, like if the client closed by himself (handleClose callback called).

I found nothing on the web that would help...

Any ideas ?

Jeremie

studio-indelebil commented 6 years ago

or maybe some advices on how to get more info on the "close" event ?

ninjatrench commented 6 years ago

This happened to me when the Websocket connection (SSL) was open for long time without exchanging any data. I solved it by keeping the communication channel busy with simple Ping Pong.

djgerbil commented 6 years ago

I'm not sure if this is the same issue but I've managed to set up my server without SSL and it all works fine, but when I enable SSL the client can send a message to the server ok, but when the server sends a reply the socket is closed, no matter the size of the message/payload. There is no error message on either the client (Web browser) or the server.

Any help/pointers would be great, thanks.

krisstakos commented 5 years ago

Any solution to this problem?

krisstakos commented 5 years ago

Any solution to this problem?

Nevermind I solved it, it was variable that overflows just before sending it