I am using the Official PHP client library for IPinfo and willing to find IP Geolocation and carrier-related data. I have downloaded its PHP Library and it is working fine from a local server which is on a direct Internet connection. Whereas, when I am trying to use it from a server inside my organization, which is having a Proxy Server forwarding port 80 requests only (Proxy Server: 10.2.1.5:3128), the request is not going through.
Usually, I achieve this through procedural PHP by:
$api_url = 'https://some.url';
$curl = curl_init($api_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_PROXY, 'http://10.2.1.5:3128'); // Adding here
$curl_response = curl_exec($curl);
curl_close($curl);
Now, in the IPinfo library, it has different sytaxt to use:
use ipinfo\ipinfo\IPinfo;
$access_token = '<my token>';
$client = new IPinfo($access_token);
$ip_address = '76.77.78.79';
$details = $client->getDetails($ip_address);
$get_region = $details->region;
...
But here, I cannot add my curl_setopt - the proxy. I have seen its IPinfo.php file as well code but nowhere find where to add the proxy details. Where and how should I add it? Please suggest.