1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:25:10 +00:00

LibWeb+LibWebSocket: DOM WebSocket subprotocol support

This adds support for WebSocket subprotocols to WebSocket DOM
objects, with some necessary plumbing to LibWebSocket and its
clients.

See the associated pull request for how this was tested.
This commit is contained in:
Guilherme Gonçalves 2022-12-31 10:37:10 +00:00 committed by Andreas Kling
parent 9115e99e4b
commit 230c0b34d4
19 changed files with 107 additions and 34 deletions

View file

@ -19,10 +19,11 @@ NonnullRefPtr<WebSocketClientManagerLadybird> WebSocketClientManagerLadybird::cr
WebSocketClientManagerLadybird::WebSocketClientManagerLadybird() = default;
WebSocketClientManagerLadybird::~WebSocketClientManagerLadybird() = default;
RefPtr<Web::WebSockets::WebSocketClientSocket> WebSocketClientManagerLadybird::connect(AK::URL const& url, DeprecatedString const& origin)
RefPtr<Web::WebSockets::WebSocketClientSocket> WebSocketClientManagerLadybird::connect(AK::URL const& url, DeprecatedString const& origin, Vector<DeprecatedString> const& protocols)
{
WebSocket::ConnectionInfo connection_info(url);
connection_info.set_origin(origin);
connection_info.set_protocols(protocols);
auto impl = adopt_ref(*new WebSocketImplQt);
auto web_socket = WebSocket::WebSocket::create(move(connection_info), move(impl));