HTTP Proxy connection interface

Provides a handler for connection via an HTTP proxy

package Requests
subpackage Proxy
since 1.6

 Methods

Constructor

__construct(array|null $args = null
since 1.6

Parameters

$args

arraynull

Array of user and password. Must have exactly two elements

Exceptions

\Requests_Exception On incorrect number of arguments (`authbasicbadargs`)

Set cURL parameters before the data is sent

curl_before_send(resource $handle) 
since 1.6

Parameters

$handle

resource

cURL resource

Add extra headers to the request before sending

fsockopen_header(string $out) 
since 1.6

Parameters

$out

string

HTTP header string

Alter remote path before getting stream data

fsockopen_remote_host_path(string $path, string $url) 
since 1.6

Parameters

$path

string

Path to send in HTTP request string ("GET ...")

$url

string

Full URL we're requesting

Alter remote socket information before opening socket connection

fsockopen_remote_socket(string $remote_socket) 
since 1.6

Parameters

$remote_socket

string

Socket connection string

Get the authentication string (user:pass)

get_auth_string() : string
since 1.6

Returns

string

Register the necessary callbacks

register(\Requests_Hooks $hooks) 

This method is called in \Requests::request when the user has set an instance as the 'auth' option. Use this callback to register all the hooks you'll need.

since 1.6
see
see
see
see
inherited_from \Requests_Proxy::register()

Parameters

$hooks

\Requests_Hooks

Hook system

 Properties

 

Password

$pass : string

Default

 

Proxy host and port

$proxy : string

Default

Notation: "host:port" (eg 127.0.0.1:8080 or someproxy.com:3128)

 

Do we need to authenticate? (ie username & password have been provided)

$use_authentication : boolean

Default

 

Username

$user : string

Default