LibWeb+WebContent: Add IPC to re-establish RequestServer connections

This commit is contained in:
Timothy Flynn 2025-08-09 13:07:57 -04:00 committed by Andreas Kling
commit b1b218596f
Notes: github-actions[bot] 2025-08-10 09:04:11 +00:00
7 changed files with 65 additions and 13 deletions

View file

@ -215,7 +215,13 @@ ErrorOr<void> WebSocket::establish_web_socket_connection(URL::URL const& url_rec
additional_headers.set("User-Agent", ResourceLoader::the().user_agent().to_byte_string());
m_websocket = ResourceLoader::the().request_client().websocket_connect(url_record, origin_string, protocol_byte_strings, {}, additional_headers);
auto request_client = ResourceLoader::the().request_client();
// FIXME: We could put this request in a queue until the client connection is re-established.
if (!request_client)
return Error::from_string_literal("RequestServer is currently unavailable");
m_websocket = request_client->websocket_connect(url_record, origin_string, protocol_byte_strings, {}, additional_headers);
m_websocket->on_open = [weak_this = make_weak_ptr<WebSocket>()] {
if (!weak_this)