Zend\Http\Client\Adapter\Proxy
HTTP Proxy-supporting Zend\Http\Client adapter class, based on the default socket based adapter.
Should be used if proxy HTTP access is required. If no proxy is set, will
fall back to Zend\Http\Client\Adapter\Socket behavior. Just like the
default Socket adapter, this adapter does not require any special extensions
installed.
Synopsis
class Proxy
extends Socket
{
- // members
- protected array $config;
- protected bool $negotiated;
- // Inherited members from Socket
- protected array $sslCryptoTypes;
- protected resource|null $socket;
- protected array $connectedTo;
- protected resource $outStream;
- protected array $config;
- protected string $method;
- protected resource $context;
- // methods
- public void setOptions()
- public void connect()
- public string write()
- protected void connectHandshake()
- public void close()
- public void __destruct()
- // Inherited methods from Socket
- public void __construct()
- public void setOptions()
- public array getConfig()
- public Socket setStreamContext()
- public resource getStreamContext()
- public void connect()
- public string write()
- public string read()
- public void close()
- protected void _checkSocketReadTimeout()
- public Socket setOutputStream()
- public void __destruct()
Hierarchy
Extends
Members
protected
- $config
—
array
Parameters array - $config
—
array
Parameters array - $connectedTo
—
array
What host/port are we connected to? - $context
—
resource
Stream context - $method
—
string
Request method - will be set by write() and might be used by read() - $negotiated
—
Zend\Http\Client\Adapter\bool
Whether HTTPS CONNECT was already negotiated with the proxy or not - $outStream
—
resource
Stream for storing output - $socket
—
Zend\Http\Client\Adapter\resource|null
The socket for server connection - $sslCryptoTypes
—
array
Map SSL transport wrappers to stream crypto method constants
Methods
protected
- connectHandshake() — Preform handshaking with HTTPS proxy using CONNECT method
public
- __destruct() — Destructor: make sure the socket is disconnected
- close() — Close the connection to the server
- connect() — Connect to the remote server
- setOptions() — Set the configuration array for the adapter
- write() — Send request to the proxy server
Inherited from Zend\Http\Client\Adapter\Socket
protected
- _checkSocketReadTimeout() — Check if the socket has timed out - if so close connection and throw an exception
public
- close() — Close the connection to the server
- connect() — Connect to the remote server
- getConfig() — Retrieve the array of all configuration options
- getStreamContext() — Get the stream context for the TCP connection to the server.
- read() — Read response from server
- setOptions() — Set the configuration array for the adapter
- setOutputStream() — Set output stream for the response
- setStreamContext() — Set the stream context for the TCP connection to the server
- write() — Send request to the remote server