LibWebView+RequestServer: Add some UI for DNS settings

This commit is contained in:
Ali Mohammad Pur 2025-04-08 03:56:35 +02:00 committed by Tim Flynn
commit 2c13504bfc
Notes: github-actions[bot] 2025-04-22 22:06:21 +00:00
12 changed files with 284 additions and 14 deletions

View file

@ -376,6 +376,13 @@ void ConnectionFromClient::set_dns_server(ByteString host_or_address, u16 port,
default_resolver()->dns.reset_connection();
}
void ConnectionFromClient::set_use_system_dns()
{
g_dns_info.server_hostname = {};
g_dns_info.server_address = {};
default_resolver()->dns.reset_connection();
}
#ifdef AK_OS_WINDOWS
void ConnectionFromClient::start_request(i32, ByteString, URL::URL, HTTP::HeaderMap, ByteBuffer, Core::ProxyData)
{

View file

@ -41,6 +41,7 @@ private:
virtual Messages::RequestServer::ConnectNewClientResponse connect_new_client() override;
virtual Messages::RequestServer::IsSupportedProtocolResponse is_supported_protocol(ByteString) override;
virtual void set_dns_server(ByteString host_or_address, u16 port, bool use_tls) override;
virtual void set_use_system_dns() override;
virtual void start_request(i32 request_id, ByteString, URL::URL, HTTP::HeaderMap, ByteBuffer, Core::ProxyData) override;
virtual Messages::RequestServer::StopRequestResponse stop_request(i32) override;
virtual Messages::RequestServer::SetCertificateResponse set_certificate(i32, ByteString, ByteString) override;

View file

@ -10,6 +10,7 @@ endpoint RequestServer
// use_tls: enable DNS over TLS
set_dns_server(ByteString host_or_address, u16 port, bool use_tls) =|
set_use_system_dns() =|
// Test if a specific protocol is supported, e.g "http"
is_supported_protocol(ByteString protocol) => (bool supported)