public function clearProxySettings($wrapper = null)
    {
        $wrappers = isset($wrapper) ? array($wrapper) : array_keys($this->_streamContextOptions);

        $clearedWrappers = array();
        $options = array('proxy', 'request_fulluri', 'header');
        foreach ($wrappers as $wrapper) {

            // remove wrapper options related to proxy settings
            if (isset($this->_streamContextOptions[$wrapper]['proxy'])) {
                foreach ($options as $option){
                    unset($this->_streamContextOptions[$wrapper][$option]);
                }

                // remove wrapper entry if there are no other options left
                if (empty($this->_streamContextOptions[$wrapper])) {
                    unset($this->_streamContextOptions[$wrapper]);
                }

                $clearedWrappers[] = $wrapper;
            }
        }

        return $clearedWrappers;
    }