Skip to content

Commit

Permalink
renamed ipOverride → curlopt_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Dec 12, 2017
1 parent 30ac372 commit bee7858
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions php/base/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ public function __construct ($options = array ()) {
$this->timeout = 10000; // in milliseconds
$this->proxy = '';
$this->headers = array ();
$this->ipOverride = '';
$this->curlopt_interface = null;

$this->markets = null;
$this->symbols = null;
$this->ids = null;
Expand Down Expand Up @@ -656,6 +656,8 @@ public function fetch ($url, $method = 'GET', $headers = null, $body = null) {
$headers[] = $key . ': ' . $value;
}

// this name for the proxy string is deprecated
// we should rename it to $this->cors everywhere
$url = $this->proxy . $url;

$verbose_headers = $headers;
Expand Down Expand Up @@ -715,12 +717,21 @@ public function fetch ($url, $method = 'GET', $headers = null, $body = null) {
print_r ("\nRequest:\n");
print_r (array ($method, $url, $verbose_headers, $body));
}
if($this->ipOverride != ''){
curl_setopt($this->curl, CURLOPT_INTERFACE, $this->ipOverride);

// we probably only need to set it once on startup
if ($this->curlopt_interface) {
curl_setopt ($this->curl, CURLOPT_INTERFACE, $this->curlopt_interface);
}
/*if($this->proxyIP){
curl_setopt($this->curl, CURLOPT_PROXY, $this->proxyIP);
}*/

/*
// this is currently not integrated, reserved for future
if ($this->proxy) {
curl_setopt ($this->curl, CURLOPT_PROXY, $this->proxy);
}
*/

curl_setopt ($this->curl, CURLOPT_FAILONERROR, false);

$response_headers = array ();
Expand Down

0 comments on commit bee7858

Please sign in to comment.