Fully Qualified Name: | Laminas\Http\Client\Adapter\Proxy |
Extends: | Socket |
HTTP Proxy-supporting Laminas\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 Laminas\Http\Client\Adapter\Socket behavior. Just like the default Socket adapter, this adapter does not require any special extensions installed.
Name | Description | Defined By |
---|---|---|
__construct() | Adapter constructor, currently empty. Config is set using setOptions() | Socket |
__destruct() | Destructor: make sure the socket is disconnected | Proxy |
close() | Close the connection to the server | Proxy |
connect() | Connect to the remote server | Proxy |
getConfig() | Retrieve the array of all configuration options | Socket |
getStreamContext() | Get the stream context for the TCP connection to the server. | Socket |
read() | Read response from server | Socket |
setOptions() | Set the configuration array for the adapter | Proxy |
setOutputStream() | Set output stream for the response | Socket |
setStreamContext() | Set the stream context for the TCP connection to the server | Socket |
write() | Send request to the proxy server | Proxy |
Adapter constructor, currently empty. Config is set using setOptions()
Returns:
Destructor: make sure the socket is disconnected
Returns:
Close the connection to the server
Returns:
Connect to the remote server
Will try to connect to the proxy server. If no proxy was set, will fall back to the target server (behave like regular Socket adapter)
Parameter Name | Type | Description |
---|---|---|
$host | string | |
$port | int | |
$secure | bool |
Returns:
Retrieve the array of all configuration options
Returns: array
Get the stream context for the TCP connection to the server.
If no stream context is set, will create a default one.
Returns: resource
Read response from server
Returns: string
Set the configuration array for the adapter
Parameter Name | Type | Description |
---|---|---|
$options | array |
Returns:
Set output stream for the response
Parameter Name | Type | Description |
---|---|---|
$stream | resource |
Returns: \Laminas\Http\Client\Adapter\Socket
Set the stream context for the TCP connection to the server
Can accept either a pre-existing stream context resource, or an array of stream options, similar to the options array passed to the stream_context_create() PHP function. In such case a new stream context will be created using the passed options.
Parameter Name | Type | Description |
---|---|---|
$context | mixed | Stream |
Returns: $this
Send request to the proxy server
Parameter Name | Type | Description |
---|---|---|
$method | string | |
$uri | \Laminas\Uri\Uri | |
$httpVer | string | |
$headers | array | |
$body | string |
Returns: string Request as string