From 42cb7037ec86741363bd8317687dd9afdefd0da8 Mon Sep 17 00:00:00 2001 From: Daniel Bagel Date: Thu, 2 Mar 2023 20:40:11 +0100 Subject: [PATCH 1/2] Use socket_proxy if set Use socket_proxy setting with curl to get maptile in requestTest() --- lib/api_testurl.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/api_testurl.php b/lib/api_testurl.php index ffeb512..f3b76f6 100644 --- a/lib/api_testurl.php +++ b/lib/api_testurl.php @@ -194,6 +194,9 @@ protected function requestTest(string $url): array curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + if(($proxy = rex::getProperty('socket_proxy')) != '') { + curl_setopt($ch, CURLOPT_PROXY, $proxy); + } $content = (string) curl_exec($ch); $returnCode = (string) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); $contentType = (string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE); From 43c5328a4fed61617a7f7258909793dcaf595cfc Mon Sep 17 00:00:00 2001 From: Daniel Bagel Date: Thu, 2 Mar 2023 20:45:03 +0100 Subject: [PATCH 2/2] Use socket_proxy if set Use socket_proxy setting with curl to get maptile in sendTile() --- lib/yform/dataset/Layer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/yform/dataset/Layer.php b/lib/yform/dataset/Layer.php index 1437968..c105178 100644 --- a/lib/yform/dataset/Layer.php +++ b/lib/yform/dataset/Layer.php @@ -468,6 +468,9 @@ public static function sendTile(int $layerId): void curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + if(($proxy = rex::getProperty('socket_proxy')) != '') { + curl_setopt($ch, CURLOPT_PROXY, $proxy); + } $content = (string) curl_exec($ch); $returnCode = (string) curl_getinfo($ch, CURLINFO_RESPONSE_CODE); $contentType = (string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE);