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;
    }