Skip to content

Add a WebSocket client upgrader.#1038

Merged
Lukasa merged 10 commits intoapple:masterfrom
tigerpixel:websocket-client-upgrader
Jul 8, 2019
Merged

Add a WebSocket client upgrader.#1038
Lukasa merged 10 commits intoapple:masterfrom
tigerpixel:websocket-client-upgrader

Conversation

@tigerpixel
Copy link
Copy Markdown
Contributor

Add a WebSocket client upgrader.

Motivation:

There is a client protocol upgrader but, unlike the server protocol upgrader, it does not have a WebSocket protocol as part of the project.

Modifications:

Made the magic WebSocket GUID public to the WebSockets project.
Added a NIOWebSocketClientUpgrader.
Added tests for the upgrader.
Updated the Linux test script files.

Result:

The project now has a WebSocket client upgrader to match the WebSocket server upgrader.

Motivation:
There is a client protocol upgrader but, unlike the server protocol upgrader, it does not have a WebSocket protocol as part of the project.

Modifications:
Made the magic WebSocket GUID public to the WebSockets project.
Added a NIOWebSocketClientUpgrader.
Added tests for the upgrader.
Updated the Linux test script files.

Result:
The project now has a WebSocket client upgrader to match the WebSocket server upgrader.
@swift-nio-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

5 similar comments
@swift-nio-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@swift-nio-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@swift-nio-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@swift-nio-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@swift-nio-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@weissi weissi added the 🆕 semver/minor Adds new public API. label Jun 18, 2019
Liam Flynn and others added 2 commits June 18, 2019 22:48
Motivation:

To ensure that the test are readable.

Modifications:

Slight changes to web socket client and client upgrader tests.

Result:

Neater WebSocket and client upgrader tests.
Copy link
Copy Markdown
Member

@weissi weissi left a comment

Choose a reason for hiding this comment

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

this looks really good, just some minor suggestions

Liam Flynn and others added 4 commits June 19, 2019 18:23
… and server upgraders.

Motivation:

To increase the legibility of the server and client upgrade classes.

Modifications:

Slight changes to web socket client and server upgraders.

Result:

Easier to read WebSocket client and server upgrade classes.
@Lukasa Lukasa added this to the 2.4.0 milestone Jun 20, 2019
@Lukasa Lukasa requested a review from weissi June 20, 2019 10:31
@Lukasa
Copy link
Copy Markdown
Contributor

Lukasa commented Jun 20, 2019

@swift-nio-bot test this please

Copy link
Copy Markdown
Member

@weissi weissi left a comment

Choose a reason for hiding this comment

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

thank you very much @tigerpixel! looks great

@Lukasa
Copy link
Copy Markdown
Contributor

Lukasa commented Jul 8, 2019

@swift-nio-bot test this please

/// This upgrader assumes that the `HTTPClientUpgradeHandler` will create and send the upgrade request.
/// This upgrader also assumes that the `HTTPClientUpgradeHandler` will appropriately mutate the
/// pipeline to remove the HTTP `ChannelHandler`s.
public final class NIOWebClientSocketUpgrader: NIOHTTPClientProtocolUpgrader {
Copy link
Copy Markdown
Contributor

@tanner0101 tanner0101 Oct 12, 2019

Choose a reason for hiding this comment

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

Is this a typo?

- NIOWebClientSocketUpgrader
+ NIOWebSocketClientUpgrader

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tanner0101 omg, yes, this is a typo :|. Mind making PR to rename (alongside a deprecated typealias to have the NIOWebClientSocketUpgrader still valid to not break SemVer).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tanner0101 @weissi Sorry, my bad. Definitely is a typo. I am not sure how that happened. Changing this will also require a change to the WebSocketClientDemo to use the updated class name rather than the old via the type alias.

I am happy to make a PR for one or both of these if you would rather not do it. Let me know.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@tigerpixel don't apologise, we all missed it :). We can land these changes in either 1 or 2 PRs, just need to make sure we retain a (deprecated) typealias so the typo'd name stays usable (for SemVer compatibility). NIO's public API breakage checker should however catch any mistakes that we might make.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants