( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ HEX
HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux mail.thebrand.ai 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/tmpr/../tmpr/../tmpr/../tmpr/../tmpr/../scraper/docs/doh_web_browser.md
DOHWebBrowser Class:  'support/doh_web_browser.php'
===================================================

The DNS Over HTTPS (DOH) web browser class integrates with DOH servers to attempt to provide more secure responses to DNS queries than standard DNS resolvers.  This drop-in replacement class for WebBrowser overrides some aspects of the WebBrowser class to provide transparent DOH support.

By default, the class uses the [Cloudflare DOH resolver](https://developers.cloudflare.com/1.1.1.1/dns-over-https/request-structure) to rewrite each web request.

Note that this class is not asynchronous/non-blocking except if a host IP has already been resolved and stored in the cache in RAM.

DOHWebBrowser::SetDOHAccessInfo($dohapi, $dohhost = false, $dohtypes = array("A", "AAAA"))
------------------------------------------------------------------------------------------

Access:  public

Parameters:

* $dohapi - A string containing the DNS Over HTTPS API to use.  Must be compatible with the Cloudflare DNS JSON API.
* $dohhost- A string containing the DNS Over HTTPS host to use (Default is false).  Use if `$dohapi` contains an IP address.
* $dohtypes - An array containing the DNS types to query in order of preference (Default is array("A", "AAAA")).

Returns:  Nothing.

This function sets the DOH access information to use when resolving DNS queries.

DOHWebBrowser::ClearDOHCache()
------------------------------

Access:  public

Parameters:  None.

Returns:  Nothing.

This function clears/flushes the shared internal resolver cache of all entries.

DOHWebBrowser::GetDOHCache()
----------------------------

Access:  public

Parameters:  None.

Returns:  An array containing the shared internal resolver cache entries.

This function returns the internal resolver cache entries.  These cached entries are shared across all DOHWebBrowser class instances.

DOHWebBrowser::InternalDNSOverHTTPSHandler(&$state)
---------------------------------------------------

Access:  public

Parameters:

* $state - An array containing state information.

Returns:  A boolean that determines whether or not the request should continue.

This internal function is the workhorse of the class.  It connects to the DOH resolver as needed, runs queries, alters the original request using the resolver response, and then lets the WebBrowser class continue on using the modified information.