( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ 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/../scraper/tests/test_dns_over_https.php
<?php
	// Tests the functionality of the DOHWebBrowser (DOH = DNS Over HTTPS) class.

	if (!isset($_SERVER["argc"]) || !$_SERVER["argc"])
	{
		echo "This file is intended to be run from the command-line.";

		exit();
	}

	// Temporary root.
	$rootpath = str_replace("\\", "/", dirname(__FILE__));

	require_once $rootpath . "/../support/web_browser.php";
	require_once $rootpath . "/../doh_web_browser.php";
	require_once $rootpath . "/../support/tag_filter.php";

	$web = new DOHWebBrowser();

	$urls = array(
		"https://cubiclesoft.com/",
		"https://barebonescms.com/",
	);

	$htmloptions = TagFilter::GetHTMLOptions();

	foreach ($urls as $url)
	{
		echo "Retrieving '" . $url . "'...\n";

		$result = $web->Process($url);
		if (!$result["success"] || $result["response"]["code"] != 200)
		{
			var_dump($result);

			exit();
		}

		$html = TagFilter::Explode($result["body"], $htmloptions);
		$root = $html->Get();

		echo "Page title:  " . $root->Find("title")->current()->GetPlainText() . "\n\n";
	}

	echo "DNS over HTTPS query results:\n";
	echo json_encode($web->GetDOHCache(), JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . "\n";
?>