public function setProxy(
        $host,
        $port,
        $ssl = false,
        $username = null,
        $password = null
    ) {
        $scheme = ($ssl ? 'https://' : 'http://');

        if ( ! is_null($username)) {
            return $this->options['proxy'] = sprintf('%s%s:%s@%s:%s', $scheme, $username, $password, $host, $port);
        }

        return $this->options['proxy'] = sprintf('%s%s:%s', $scheme, $host, $port);
    }
public function setProxy(
        $host,
        $port,
        $ssl = false,
        $username = null,
        $password = null
    ) {
        $scheme = ($ssl ? 'https://' : 'http://');

        if ( ! is_null($username)) {
            return $this->options['proxy'] = sprintf('%s%s:%s@%s:%s', $scheme, $username, $password, $host, $port);
        }

        return $this->options['proxy'] = sprintf('%s%s:%s', $scheme, $host, $port);
    }
public function setProxy ( $ host , $ port , $ ssl = false , $ username = null , $ password = null ) { $ scheme = ( $ ssl ? 'https://' : 'http://' ) ; if ( ! is_null ( $ username ) ) { return $ this -> options [ 'proxy' ] = sprintf ( '%s%s:%s@%s:%s' , $ scheme , $ username , $ password , $ host , $ port ) ; } return $ this -> options [ 'proxy' ] = sprintf ( '%s%s:%s' , $ scheme , $ host , $ port ) ; }
Enable proxy if needed.

@param string $host
@param int $port
@param bool $ssl
@param string $username
@param string $password
@return string
Enable proxy if needed .