function ProxyItem::toRequestProxy
Returns a RequestProxy instance for the scheme of the request url
Parameters
string $scheme The scheme of the request url:
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Http/ ProxyItem.php, line 105
Class
- ProxyItem
- @internal @author John Stevenson <john-stevenson@blueyonder.co.uk>
Namespace
Composer\Util\HttpCode
public function toRequestProxy(string $scheme) : RequestProxy {
$options = [
'http' => [
'proxy' => $this->optionsProxy,
],
];
if ($this->optionsAuth !== null) {
$options['http']['header'] = $this->optionsAuth;
}
if ($scheme === 'http') {
$options['http']['request_fulluri'] = true;
}
return new RequestProxy($this->url, $this->curlAuth, $options, $this->safeUrl);
}