You are here

private function StreamHandler::add_proxy in Lockr 7.3

File

vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php, line 395

Class

StreamHandler
HTTP handler that uses PHP's HTTP stream wrapper.

Namespace

GuzzleHttp\Handler

Code

private function add_proxy(RequestInterface $request, &$options, $value, &$params) {
  if (!is_array($value)) {
    $options['http']['proxy'] = $value;
  }
  else {
    $scheme = $request
      ->getUri()
      ->getScheme();
    if (isset($value[$scheme])) {
      if (!isset($value['no']) || !\GuzzleHttp\is_host_in_noproxy($request
        ->getUri()
        ->getHost(), $value['no'])) {
        $options['http']['proxy'] = $value[$scheme];
      }
    }
  }
}