Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Possibility of using an http proxy #74

Open
lucuhb opened this issue Jun 28, 2016 · 0 comments
Open

Possibility of using an http proxy #74

lucuhb opened this issue Jun 28, 2016 · 0 comments

Comments

@lucuhb
Copy link

lucuhb commented Jun 28, 2016

Hi,
First, thanks for this bundle !

I have a problem with the bundle because my server should use an HTTP Proxy to go out and access the paybox server.
Here is the error : "Warning: DOMDocument::loadHTML(): Empty string supplied as input" in vendor/lexik/paybox-bundle/Paybox/AbstractRequest.php at line 152

To access to the paybox server, a new curl option CURLOPT_PROXY should be added in the getWebPage function of AbstractRequest.php, like this :

 protected function getWebPage($url)    {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL,            $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($curl, CURLOPT_HEADER,         false);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); 
    curl_setopt($curl, CURLOPT_PROXY,'xxx.xxxx.xxx.xx:port' true); <- this line
    $output = curl_exec($curl);
    curl_close($curl);
   return (string) $output;
}

Is it possible to add new parameters in configuration of this bundle to define the IP address of the HTTP proxy and its port and, if they are defined , add the necessary line in getWebPage function?

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant