Phalcon\Http\Client\Provider\Curl::setProxy PHP Method

setProxy() public method

public setProxy ( $host, $port = 8080, $user = null, $pass = null )
    public function setProxy($host, $port = 8080, $user = null, $pass = null)
    {
        $this->setOptions([CURLOPT_PROXY => $host, CURLOPT_PROXYPORT => $port]);
        if (!empty($user) && is_string($user)) {
            $pair = $user;
            if (!empty($pass) && is_string($pass)) {
                $pair .= ':' . $pass;
            }
            $this->setOption(CURLOPT_PROXYUSERPWD, $pair);
        }
    }