Overview

Packages

  • Requests
    • Authentication
    • Cookies
    • Proxy
    • Session
    • Transport
    • Utilities

Classes

  • Requests_Proxy_HTTP

Interfaces

  • Requests_Proxy
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Warning! You are currently reading the documentation for Requests 1.x.

It is recommended to upgrade to Requests 2.x at your earliest convenience. Upgrading to Requests 2.x is fairly straight-forward.
A full list of the changes can be found in the Changelog.

Visit the documentation for Requests_Proxy_HTTP in Requests 2.x.

Class Requests_Proxy_HTTP

HTTP Proxy connection interface

Provides a handler for connection via an HTTP proxy

Requests_Proxy_HTTP implements Requests_Proxy
Package: Requests\Proxy
Since: 1.6
Located at Requests/Proxy/HTTP.php
Methods summary
public
# __construct( array|null $args = null )

Constructor

Constructor

Parameters

$args
Array of user and password. Must have exactly two elements

Throws

Requests_Exception
On incorrect number of arguments (authbasicbadargs)

Since

1.6
public
# register( Requests_Hooks $hooks )

Register the necessary callbacks

Register the necessary callbacks

Parameters

$hooks
Hook system

Since

1.6

See

Requests_Proxy_HTTP::curl_before_send()
Requests_Proxy_HTTP::fsockopen_remote_socket()
Requests_Proxy_HTTP::fsockopen_remote_host_path()
Requests_Proxy_HTTP::fsockopen_header()

Implementation of

Requests_Proxy::register()
public
# curl_before_send( resource & $handle )

Set cURL parameters before the data is sent

Set cURL parameters before the data is sent

Parameters

$handle
cURL resource

Since

1.6
public
# fsockopen_remote_socket( string & $remote_socket )

Alter remote socket information before opening socket connection

Alter remote socket information before opening socket connection

Parameters

$remote_socket
Socket connection string

Since

1.6
public
# fsockopen_remote_host_path( string & $path, string $url )

Alter remote path before getting stream data

Alter remote path before getting stream data

Parameters

$path
Path to send in HTTP request string ("GET ...")
$url
Full URL we're requesting

Since

1.6
public
# fsockopen_header( string & $out )

Add extra headers to the request before sending

Add extra headers to the request before sending

Parameters

$out
HTTP header string

Since

1.6
public string
# get_auth_string( )

Get the authentication string (user:pass)

Get the authentication string (user:pass)

Returns

string

Since

1.6
Properties summary
public string $proxy

Proxy host and port

Proxy host and port

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

#
public string $user

Username

Username

#
public string $pass

Password

Password

#
public boolean $use_authentication

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

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

#
Requests 1.8.1 API Documentation API documentation generated by ApiGen