2024-09-19 07:54:24 +02:00
|
|
|
#include <LibCore/Proxy.h>
|
2025-11-26 14:13:23 -05:00
|
|
|
#include <LibHTTP/Header.h>
|
2024-03-18 16:22:27 +13:00
|
|
|
#include <LibURL/URL.h>
|
2024-09-19 07:54:24 +02:00
|
|
|
#include <RequestServer/CacheLevel.h>
|
2021-07-02 21:40:44 -07:00
|
|
|
|
2021-04-23 22:45:52 +02:00
|
|
|
endpoint RequestServer
|
|
|
|
|
{
|
2025-01-03 21:19:46 +05:00
|
|
|
init_transport(int peer_pid) => (int peer_pid)
|
2024-04-17 18:44:39 -06:00
|
|
|
connect_new_client() => (IPC::File client_socket)
|
2025-08-09 13:04:48 -04:00
|
|
|
connect_new_clients(size_t count) => (Vector<IPC::File> sockets)
|
2024-04-10 16:02:40 -06:00
|
|
|
|
2024-11-01 23:53:43 +01:00
|
|
|
// use_tls: enable DNS over TLS
|
2025-05-13 12:34:55 +02:00
|
|
|
set_dns_server(ByteString host_or_address, u16 port, bool use_tls, bool validate_dnssec_locally) =|
|
2025-04-08 03:56:35 +02:00
|
|
|
set_use_system_dns() =|
|
2024-11-01 23:53:43 +01:00
|
|
|
|
2021-04-23 22:45:52 +02:00
|
|
|
// Test if a specific protocol is supported, e.g "http"
|
2023-12-16 17:49:34 +03:30
|
|
|
is_supported_protocol(ByteString protocol) => (bool supported)
|
2021-04-23 22:45:52 +02:00
|
|
|
|
2025-11-26 14:13:23 -05:00
|
|
|
start_request(i32 request_id, ByteString method, URL::URL url, Vector<HTTP::Header> request_headers, ByteBuffer request_body, Core::ProxyData proxy_data) =|
|
2021-05-03 15:52:56 +02:00
|
|
|
stop_request(i32 request_id) => (bool success)
|
2023-12-16 17:49:34 +03:30
|
|
|
set_certificate(i32 request_id, ByteString certificate, ByteString key) => (bool success)
|
2021-09-28 00:06:52 +03:30
|
|
|
|
2024-03-18 16:22:27 +13:00
|
|
|
ensure_connection(URL::URL url, ::RequestServer::CacheLevel cache_level) =|
|
2024-03-06 01:50:52 +01:00
|
|
|
|
2025-11-02 13:10:27 -05:00
|
|
|
estimate_cache_size_accessed_since(u64 cache_size_estimation_id, UnixDateTime since) =|
|
2025-11-02 16:44:30 -05:00
|
|
|
remove_cache_entries_accessed_since(UnixDateTime since) =|
|
2025-10-09 14:24:47 -04:00
|
|
|
|
2024-03-06 01:50:52 +01:00
|
|
|
// Websocket Connection API
|
2025-11-26 14:13:23 -05:00
|
|
|
websocket_connect(i64 websocket_id, URL::URL url, ByteString origin, Vector<ByteString> protocols, Vector<ByteString> extensions, Vector<HTTP::Header> additional_request_headers) =|
|
2024-09-18 10:28:55 +02:00
|
|
|
websocket_send(i64 websocket_id, bool is_text, ByteBuffer data) =|
|
|
|
|
|
websocket_close(i64 websocket_id, u16 code, ByteString reason) =|
|
|
|
|
|
websocket_set_certificate(i64 request_id, ByteString certificate, ByteString key) => (bool success)
|
2024-08-03 13:24:56 -04:00
|
|
|
|
2021-04-23 22:45:52 +02:00
|
|
|
}
|