It seems there is a problem while trying to close websocket connection from firefox (8.0.1).
When using Chrome, if you use WebSocket.close() the connection is closed immediately, in firefox i can wait about 30 seconds until it close the connection with error.
Any suggestions to bypass this problem in firefox?
You can run into that error if the server doesn’t support the handshake format that is sent from firefox. I’ve run into that error with Aleph because it didn’t properly support multiple values in the Connection header of the handshake which is legitimate for firefox to do, but is also different from how Chrome behaves (only one value in the connection header).
If the client sends you a close message (opcode 0x8) the server should respond with a close message for clean shutdown. From the spec: "If an endpoint receives a Close frame and did not previously send a Close frame, the endpoint MUST send a Close frame in response." If the server is disconnecting the client for some reason, the server should send a close message. See section 5.5.1 and 7.4 of the spec.