public function setProxy($url, $username = null, $password = "")
    {
        $this->setCurlOption(CURLOPT_PROXY, $url);
        if (!is_null($username)) {
            $this->setCurlOption(CURLOPT_PROXYUSERPWD, "$username:$password");
        }
    }