public function addProxySettings($server, $port = 3128, $wrapper = 'http', $username = null, $password = null)
    {
        $settings = array($wrapper => array(
            'proxy'             => sprintf('tcp://%s:%d', $server, $port),
            'request_fulluri'   => true,
        ));

        // Proxy authentication (optional)
        if (isset($username) && isset($password)) {
            $settings[$wrapper]['header'] = 'Proxy-Authorization: Basic '.base64_encode($username.':'.$password);
        }

        // Add these new settings to the stream context options array
        $this->_streamContextOptions = array_merge(
            $this->_streamContextOptions,
            $settings
        );

        /* Return $this so we can chain addProxySettings() calls like this:
         * $browscap->
         *   addProxySettings('http')->
         *   addProxySettings('https')->
         *   addProxySettings('ftp');
         */
        return $this;
    }
public function addProxySettings($server, $port = 3128, $wrapper = 'http', $username = null, $password = null)
    {
        $settings = array($wrapper => array(
            'proxy'             => sprintf('tcp://%s:%d', $server, $port),
            'request_fulluri'   => true,
        ));

        // Proxy authentication (optional)
        if (isset($username) && isset($password)) {
            $settings[$wrapper]['header'] = 'Proxy-Authorization: Basic '.base64_encode($username.':'.$password);
        }

        // Add these new settings to the stream context options array
        $this->_streamContextOptions = array_merge(
            $this->_streamContextOptions,
            $settings
        );

        /* Return $this so we can chain addProxySettings() calls like this:
         * $browscap->
         *   addProxySettings('http')->
         *   addProxySettings('https')->
         *   addProxySettings('ftp');
         */
        return $this;
    }
public function addProxySettings ( $ server , $ port = 3128 , $ wrapper = 'http' , $ username = null , $ password = null ) { $ settings = array ( $ wrapper => array ( 'proxy' => sprintf ( 'tcp://%s:%d' , $ server , $ port ) , 'request_fulluri' => true , ) ) ; // Proxy authentication (optional) if ( isset ( $ username ) && isset ( $ password ) ) { $ settings [ $ wrapper ] [ 'header' ] = 'Proxy-Authorization: Basic ' . base64_encode ( $ username . ':' . $ password ) ; } // Add these new settings to the stream context options array $ this -> _streamContextOptions = array_merge ( $ this -> _streamContextOptions , $ settings ) ; /* Return $this so we can chain addProxySettings() calls like this:
         * $browscap->
         *   addProxySettings('http')->
         *   addProxySettings('https')->
         *   addProxySettings('ftp');
         */ return $ this ; }
Add proxy settings to the stream context array.

@param string $server    Proxy server/host
@param int    $port      Port
@param string $wrapper   Wrapper: "http", "https", "ftp", others...
@param string $username  Username (when requiring authentication)
@param string $password  Password (when requiring authentication)

@return Browscap
Add proxy settings to the stream context array .