From 41d8c16d8422177fc7e542e1be620d4fc153a743 Mon Sep 17 00:00:00 2001 From: dan612 Date: Sun, 7 Dec 2025 12:54:55 -0500 Subject: [PATCH] Adding proxy script for bypassing ddev container during imports. --- composer.json | 3 ++- proxy.php | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 proxy.php diff --git a/composer.json b/composer.json index c7cc536..b3b966d 100644 --- a/composer.json +++ b/composer.json @@ -154,6 +154,7 @@ }, "scripts": { "build-fe": "cd web/themes/custom/dchadwick && npm ci && npm run compile", - "deploy": "sh scripts/deploy.sh" + "deploy": "sh scripts/deploy.sh", + "start-proxy": "php -S 0.0.0.0:8888 proxy.php" } } diff --git a/proxy.php b/proxy.php new file mode 100644 index 0000000..395c230 --- /dev/null +++ b/proxy.php @@ -0,0 +1,24 @@ + 'No URL provided']); + exit; +} + +$ch = curl_init($url); +curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); +curl_setopt($ch, CURLOPT_HTTPHEADER, [ + 'Accept: application/vnd.api+json', + 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15' +]); + +$response = curl_exec($ch); +$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); +curl_close($ch); + +http_response_code($httpCode); +header('Content-Type: application/vnd.api+json'); +echo $response;