$this->multi =
new AmpClientState($clientConfigurator,
$maxHostConnections,
$maxPendingPushes,
$this->logger
);
} /**
* @see HttpClientInterface::OPTIONS_DEFAULTS for available options
*/
public function request(string
$method, string
$url, array
$options =
[]): ResponseInterface
{ [$url,
$options] = self::
prepareRequest($method,
$url,
$options,
$this->defaultOptions
);
$options['proxy'
] = self::
getProxy($options['proxy'
],
$url,
$options['no_proxy'
]);
if (null !==
$options['proxy'
] && !
class_exists(Http1TunnelConnector::
class)) { throw new \
LogicException('You cannot use the "proxy" option as the "amphp/http-tunnel" package is not installed. Try running "composer require amphp/http-tunnel".'
);
} if ($options['bindto'
]) { if (str_starts_with($options['bindto'
], 'if!'
)) { throw new TransportException(__CLASS__.' cannot bind to network interfaces, use e.g. CurlHttpClient instead.'
);
} if (str_starts_with($options['bindto'
], 'host!'
)) { $options['bindto'
] =
substr($options['bindto'
], 5
);
}