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 multiple subprotocols in Websocket handshake for client side #2607
Support multiple subprotocols in Websocket handshake for client side #2607
Conversation
Hi @RomanBrodetski, Thank you for your contribution! We really value the time you've taken to put this together. Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement: |
Thank you for your pull request! After a quick sanity check one of the team will reply with 'OK TO TEST' to kick off our automated validation on Jenkins. This compiles the project, runs the tests, and checks for things like binary compatibility and source code formatting. When two team members have also manually reviewed and (perhaps after asking for some amendments) accepted your contribution, it should be good to be merged. For more details about our contributing process, check out CONTRIBUTING.md - and feel free to ask! |
OK TO TEST |
Test FAILed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks useful!
akka-http-core/src/main/scala/akka/http/impl/engine/ws/WebSocketClientBlueprint.scala
Show resolved
Hide resolved
(failure was unrelated, #2349) |
PLS BUILD |
Test PASSed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The clean way would be to change WebSocketRequest
to support a list of subprotocols directly, however, that might be hard to achieve binary-compatibly.
Could you at least add another apply method to WebSocketRequest
that takes a subprotocols: Seq[String]
instead of an subprotocol: Option[String]
, so that this can become the official way of specifying multiple subprotocols?
Co-authored-by: Anton Onyshchenko <anton.onishchenko@gmail.com>
ad6d1a3
to
e482c53
Compare
Test PASSed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @RomanBrodetski. LGTM
Currently passing multiple websockets subprotocols in
Sec-WebSocket-Protocol
header is not supported (see #2606). This PR makes it possible to do so, passing them separated by comma insubprotocol: Option[String]
field of theWebSocketRequest
model. This corresponds to theSec-WebSocket-Protocol
header definition in RFC 6455A better solution would be to change the
WebSocketRequest
model to accept asubprotocols: Seq[String]
field, but that would break compatibility with current client code. If it, nevertheless, makes sense to do this change, please let us know - we are happy to submit a corresponding PR.References #2606