From 2b22c961ddf26e5d884c6b5d36265013b26a9911 Mon Sep 17 00:00:00 2001 From: Abdelkarim CHAMLAL Date: Thu, 24 Nov 2022 12:52:50 +0100 Subject: [PATCH] ipv4 first approach --- src/Feed.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Feed.php b/src/Feed.php index 3a59c27..c00c761 100644 --- a/src/Feed.php +++ b/src/Feed.php @@ -216,6 +216,11 @@ private static function httpRequest($url, $user, $pass) curl_setopt($curl, CURLOPT_USERAGENT, self::$userAgent); // some feeds require a user agent curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_TIMEOUT, 20); + + if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) { + curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + } + curl_setopt($curl, CURLOPT_ENCODING, ''); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // no echo, just return result curl_setopt($curl, CURLOPT_USERAGENT, '');