Skip to content

Conversation

@wulczer
Copy link

@wulczer wulczer commented May 15, 2011

As specified in http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76#section-4.2 WebSocket frames can also be of type 0xFF, with a length specification followed by arbitrary data, that the server should discard. The first commit implements parsing this type of frames. The parsing process has been overhauled by using twisted.web._newclient.makeStatefulDispatch, so it introduces a dependency on Twisted 9.0.0 (I hope it's OK, if not it's easy to do the dispatch by hand).

The second commit implements the closing handshake that can be initiated by the client, as described in http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76#section-1.4. Without this, closing the browser while it's connected to the WebSocket server results in a traceback in the server log (this happens both with Chrome and Firefox native WebSockets and with web-socket-js).

wulczer added 4 commits May 15, 2011 21:18
Support 0xFF frames, as specified in the WebSocket protocol draft
hixie-76, section 5.3. Introduce a separate instance variable
controlling the maximum size of a 0xFF frame that the server will accept.
Specified in section 1.4 of hixie-76, the closing handshake can be
initiated by either peer. Support closing handshakes initiated by the
client, the server does not have the ability to initiate closing
handshakes himself.
Otherwise the frameLengthExceeded handler can be called multiple times
while decoding the length.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant