mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 03:22:43 +00:00 
			
		
		
		
	Everywhere: Merge the WebSocket service into RequestServer
This keeps the APIs separate as they are wildly different, a future improvement could be to somehow unify the APIs (if possible). Closes #23080.
This commit is contained in:
		
							parent
							
								
									daf5484d6b
								
							
						
					
					
						commit
						6dfb2f9dc8
					
				
					 56 changed files with 231 additions and 845 deletions
				
			
		|  | @ -4,6 +4,7 @@ | |||
|  * SPDX-License-Identifier: BSD-2-Clause | ||||
|  */ | ||||
| 
 | ||||
| #include "WebSocketClientAdapter.h" | ||||
| #include <LibProtocol/Request.h> | ||||
| #include <LibProtocol/RequestClient.h> | ||||
| #include <LibWebView/RequestServerAdapter.h> | ||||
|  | @ -94,6 +95,14 @@ RefPtr<Web::ResourceLoaderConnectorRequest> RequestServerAdapter::start_request( | |||
|     return RequestServerRequestAdapter::try_create(protocol_request.release_nonnull()).release_value_but_fixme_should_propagate_errors(); | ||||
| } | ||||
| 
 | ||||
| RefPtr<Web::WebSockets::WebSocketClientSocket> RequestServerAdapter::websocket_connect(AK::URL const& url, AK::ByteString const& origin, Vector<AK::ByteString> const& protocols) | ||||
| { | ||||
|     auto underlying_websocket = m_protocol_client->websocket_connect(url, origin, protocols); | ||||
|     if (!underlying_websocket) | ||||
|         return {}; | ||||
|     return WebSocketClientSocketAdapter::create(underlying_websocket.release_nonnull()); | ||||
| } | ||||
| 
 | ||||
| void RequestServerAdapter::prefetch_dns(URL const& url) | ||||
| { | ||||
|     m_protocol_client->ensure_connection(url, RequestServer::CacheLevel::ResolveOnly); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ali Mohammad Pur
						Ali Mohammad Pur