-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support the hybi-10 version of the WebSocket protocol #13
Open
wulczer
wants to merge
14
commits into
rlotun:master
Choose a base branch
from
wulczer:hybi-10
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
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.
Thanks for this! I'll take a look at it and merge it in very soon. |
And what is a status of this review? |
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.