Support the hybi-10 version of the WebSocket protocol#13
Open
wulczer wants to merge 14 commits intorlotun:masterfrom
Open
Support the hybi-10 version of the WebSocket protocol#13wulczer wants to merge 14 commits intorlotun:masterfrom
wulczer wants to merge 14 commits intorlotun:masterfrom
Conversation
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.
This protocol version is defined in http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10 and is incompatible with the currently popular hixie-76 version. Add code to handle the new handshake and data framing. Still missing is support for fragmented frames and unit tests. There is probably a couple of bugs hiding in there, but it was successfully tested with Chromium 15.0.839.0, which implements hybi-10.
Commit 752241f accditentally ended up hooking the hybi-10 protocol decoder to requests using the pre-hixie-75 handshake.
Otherwise the frameLengthExceeded handler can be called multiple times while decoding the length.
In passing fix a few bugs where opcodes were mismatched and frame fragments were lost.
The decoder does not have a reference to the transport, it has to go through the handler.
Empty frames were putting the decoder in the PAYLOAD state, from which it was never recovering because no payload was ever received.
Owner
|
Thanks for this! I'll take a look at it and merge it in very soon. |
|
And what is a status of this review? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes make txWebSocket support hybi-10, as explained in #12
My hybi-10 branch relies on my binary-frames-closing-handshake, because of the makeStatefulDispatcher usage. This pull request incorporates both of these branches, I believe.