mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +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:
committed by
Andreas Kling
parent
9115e99e4b
commit
230c0b34d4
@@ -75,6 +75,15 @@ Messages::WebSocketServer::ReadyStateResponse ConnectionFromClient::ready_state(
|
||||
return (u32)ReadyState::Closed;
|
||||
}
|
||||
|
||||
Messages::WebSocketServer::SubprotocolInUseResponse ConnectionFromClient::subprotocol_in_use(i32 connection_id)
|
||||
{
|
||||
RefPtr<WebSocket> connection = m_connections.get(connection_id).value_or({});
|
||||
if (connection) {
|
||||
return connection->subprotocol_in_use();
|
||||
}
|
||||
return DeprecatedString::empty();
|
||||
}
|
||||
|
||||
void ConnectionFromClient::send(i32 connection_id, bool is_text, ByteBuffer const& data)
|
||||
{
|
||||
RefPtr<WebSocket> connection = m_connections.get(connection_id).value_or({});
|
||||
|
||||
Reference in New Issue
Block a user