Skip to content
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 websocket compression #339

Merged
merged 7 commits into from
Jun 24, 2017
Merged

Conversation

joejune
Copy link
Contributor

@joejune joejune commented May 25, 2017

Fixes #169.

Using the Autobahn test suite, I confirmed that these changes perform comparably with the Autobahn library itself. See attached report:

autobahn_test.html.zip

@@ -577,6 +597,34 @@ open class WebSocket : NSObject, StreamDelegate {
}
if let cfHeaders = CFHTTPMessageCopyAllHeaderFields(response) {
let headers = cfHeaders.takeRetainedValue() as NSDictionary
if let extensionHeader = headers[headerWSExtensionName as NSString] as? NSString {
let parts = extensionHeader.components(separatedBy: ";")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for readability what about moving this out to another method. There are already some uber methods on this class personally my preference on this is to keep method size down where it makes logical sense.

// Created by Joseph Ross on 5/23/17.
// Copyright © 2017 Vluxe. All rights reserved.
//

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the spec here so that later if there is a bug one can quickly find the reference to follow: https://tools.ietf.org/html/rfc7692

@hishnash
Copy link
Contributor

Consider adding a short section to the readme for users.

@joejune
Copy link
Contributor Author

joejune commented May 25, 2017

@hishnash: Thanks for the great feedback. I've made all the changes you suggested.

@rakeshpethani
Copy link

When is this support going to be available ?

@kiyoshi-shikuma
Copy link

+1 Also interested in this

@joejune
Copy link
Contributor Author

joejune commented Jun 15, 2017

@daltoniam: Is there anything I can do to help this PR land? Would it be better if I made compression disabled by default, and those who want to use it have to opt-in?

@daltoniam
Copy link
Owner

@joejune thank you much for this, it looks great. Also sorry for the delay, got distracted with life and WWDC. Love the tests, README updates, autobahn tests, very through much appreciated.

@daltoniam daltoniam merged commit 7bf478c into daltoniam:master Jun 24, 2017
@nuclearace
Copy link
Contributor

Did you test this with the Swift Package Manager? I have a feeling it might not like that you've included zlib outside of Sources.

@daltoniam
Copy link
Owner

ah right, package managers 😄. I have not done that yet, might have to fix that.

@daltoniam
Copy link
Owner

@nuclearace is there a way to test the package manager without have to create a new tag?

@nuclearace
Copy link
Contributor

Uh, if you create an app that has Starscream as a dependency and then put Starscream into edit mode.

@nuclearace
Copy link
Contributor

Actually I take that back, that wouldn't really help test if the dependency itself is right. I can't remember if they've added the ability to point to a branch

@daltoniam
Copy link
Owner

@daltoniam
Copy link
Owner

I guess I'll just create a test tag and work off of that (2.1.0).

@daltoniam
Copy link
Owner

@daltoniam
Copy link
Owner

@nuclearace I figured it out. I updated the 2.1.0 to build properly again.

@joejune
Copy link
Contributor Author

joejune commented Jun 26, 2017

Thanks for getting this merged in. I haven't worked with Swift Package Manager yet, so thanks for taking care of that aspect.

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.

7 participants