mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:58:11 +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:
parent
9115e99e4b
commit
230c0b34d4
19 changed files with 107 additions and 34 deletions
|
@ -592,6 +592,11 @@ public:
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
virtual DeprecatedString subprotocol_in_use() override
|
||||
{
|
||||
return m_websocket->subprotocol_in_use();
|
||||
}
|
||||
|
||||
virtual void send(ByteBuffer binary_or_text_message, bool is_text) override
|
||||
{
|
||||
m_websocket->send(WebSocket::Message(binary_or_text_message, is_text));
|
||||
|
@ -661,10 +666,11 @@ public:
|
|||
|
||||
virtual ~HeadlessWebSocketClientManager() override { }
|
||||
|
||||
virtual RefPtr<Web::WebSockets::WebSocketClientSocket> connect(AK::URL const& url, DeprecatedString const& origin) override
|
||||
virtual RefPtr<Web::WebSockets::WebSocketClientSocket> connect(AK::URL const& url, DeprecatedString const& origin, Vector<DeprecatedString> const& protocols) override
|
||||
{
|
||||
WebSocket::ConnectionInfo connection_info(url);
|
||||
connection_info.set_origin(origin);
|
||||
connection_info.set_protocols(protocols);
|
||||
|
||||
auto connection = HeadlessWebSocket::create(WebSocket::WebSocket::create(move(connection_info)));
|
||||
return connection;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue