If you're using a proxy, you can either override the HttpClient or use environment variable.
If you're using the default Guzzle6HttpClient
(recommended):
use Algolia\AlgoliaSearch\Algolia;
$httpClient = new Algolia\AlgoliaSearch\Http\Guzzle6HttpClient([
'proxy' => $proxyAddress,
]);
Algolia::setHttpClient($httpClient);
If you're using the default Php53HttpClient
:
use Algolia\AlgoliaSearch\Algolia;
$httpClient = new Algolia\AlgoliaSearch\Http\Php53HttpClient([
'CURLOPT_PROXY' => $strProxy,
'CURLOPT_FOLLOWLOCATION' => 1,
]);
Algolia::setHttpClient($httpClient);
Note that this method is only supported by the Guzzle6HttpClient
.
Set the HTTPS_PROXY
env variable to your secured proxy URL. If some domain should bypass the proxy,
you can set them as a comma-separated list in the NO_PROXY
env variable.