Set HTTP proxy information

@param string $proxy format http://[username:password]@hostname[:port]
@throws ConfigurationException
189116
public function setHttpProxy($proxy)
    {
        $urlParts = parse_url($proxy);
        if ($urlParts == false || !array_key_exists("host", $urlParts)) {
            throw new ConfigurationException("Invalid proxy configuration " . $proxy);
        }
        $this->soapOptions['proxy_host'] = $urlParts["host"];
        if (isset($urlParts["port"])) {
            $this->soapOptions['proxy_port'] = $urlParts["port"];
        }
        if (isset($urlParts["user"])) {
            $this->soapOptions['proxy_login'] = $urlParts["user"];
            $this->soapOptions['proxy_password'] = $urlParts["pass"];
        }
    }
495929
public function updateProxy(ProxyGenerator &$proxy)
    {
        $proxy = $proxy->addMethod('manipulate', function ($args, $next) {
            $manipulation = $args[0];
            SearchUpdater::handle_manipulation($manipulation);
            return $next(...$args);
        });
    }
66445
public function setProxy($host, $port, $type = CURLPROXY_HTTP)
    {
        if (!empty($host) && !empty($port)) {
            $this->proxyHost = stripslashes(trim($host));
            $this->proxyPort = intval($port);
            $this->proxyType = intval($type);
        }
    }
715204
public void setProxy(Proxy proxy)
    {
        if(proxy != null)
        {
            java.net.Proxy p = new java.net.Proxy(java.net.Proxy.Type.HTTP,
                    new InetSocketAddress(proxy.getHost(), proxy.getPort()));
            client.setProxy(p);
        }
        else
            client.setProxy(java.net.Proxy.NO_PROXY);
    }
1140286
private static function curlInit($proxy) {
        $ch = curl_init();
        curl_setopt_array($ch, array(
            CURLOPT_FOLLOWLOCATION => !ini_get('safe_mode') && (string)ini_get('open_basedir') === '',
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => true,
            CURLOPT_ENCODING       => 'gzip',
            CURLOPT_COOKIEJAR      => '',
            CURLOPT_CONNECTTIMEOUT => self::CURLOPT_CONNECTTIMEOUT,
            CURLOPT_TIMEOUT        => self::CURLOPT_TIMEOUT,
        ));
        if ($proxy !== '') {
            if (false === $p = parse_url($proxy)) {
                throw new TwistException('The value of $proxy is invalid: Failed to parse.');
            }
            if (!isset($p['scheme'])) {
                throw new TwistException('The value of $proxy is invalid: Has no scheme.');
            }
            if (!isset($p['host'])) {
                throw new TwistException('The value of $proxy is invalid: Has no host.');
            }
            if (isset($p['path'])) {
                throw new TwistException('The value of $proxy is invalid: Has path.');
            }
            if (isset($p['query'])) {
                throw new TwistException('The value of $proxy is invalid: Has query.');
            }
            if (isset($p['fragment'])) {
                throw new TwistException('The value of $proxy is invalid: Has fragment.');
            }
            curl_setopt_array($ch, array(
                CURLOPT_HTTPPROXYTUNNEL => $p['scheme'] === 'https',
                CURLOPT_PROXY           => $p['scheme'] . '://' . $p['host'] . (isset($p['port']) ? ':' . $p['port'] : ''),
                CURLOPT_PROXYUSERPWD    => (isset($p['user']) ? $p['user'] : 'anonymous') . ':' . (isset($p['pass']) ? $p['pass'] : ''),
            ));
            if (isset($p['port'])) {
                curl_setopt($ch, CURLOPT_PROXYPORT, $p['port']);
            }
        }
        return $ch;
    }
28329
public static function setProxy($host, $user = null, $pass = null, $type = CURLPROXY_SOCKS5)
	{
		self::$proxy = array('host' => $host, 'type' => $type, 'user' => $user, 'pass' => $pass);
	}
598378
public function resetUninitializedProxy(Proxy $proxy)
    {
        if ($proxy->__isInitialized()) {
            throw InvalidArgumentException::unitializedProxyExpected($proxy);
        }

        $className  = ClassUtils::getClass($proxy);
        $definition = isset($this->definitions[$className])
            ? $this->definitions[$className]
            : $this->getProxyDefinition($className);

        $proxy->__setInitializer($definition->initializer);
        $proxy->__setCloner($definition->cloner);

        return $proxy;
    }
750632
public function setProxy(\Victoire\Bundle\CoreBundle\Entity\EntityProxy $proxy = null)
    {
        $this->proxy = $proxy;

        return $this;
    }
802560
public void setProxy(String proxyhost, int proxyport) {
		proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress(proxyhost, proxyport));
	}
1197554
private void setProxy(String proxyStr) {
    String[] strs = proxyStr.split(":", 2);
    if (strs.length != 2)
      throw new RuntimeException("Bad SOCKS proxy parameter: " + proxyStr);
    String host = strs[0];
    int port = Integer.parseInt(strs[1]);
    this.proxy =
        new Proxy(Proxy.Type.SOCKS, InetSocketAddress.createUnresolved(host,
            port));
  }
231214
private function setConfig($config)
    {
        $allowedConfigKeys = [
            'host',
            'port',
            'sasl_user',
            'sasl_password',
        ];

        foreach ($config as $key => $server) {
            (false === is_array($server)) ? $this->checkSimpleConfigArray($key, $allowedConfigKeys) : $this->checkMultidimensionalConfigArray($server, $allowedConfigKeys);
        }

        $this->config = $config;
    }
942527
protected function setUpGeneralConfigurations(Configuration $config)
    {
        $this->setupAnnotationMetadata();
        $config->setMetadataDriverImpl($this->getMetadataMappingDriver());

        $config->setProxyDir($this->getProxiesPath());
        $config->setProxyNamespace($this->getProxiesNamespace());
        $config->setAutoGenerateProxyClasses($this->getProxiesAutoGeneration());

        $config->setMetadataCacheImpl($this->getMetadataCacheDriver());
    }
1145256
def configure_proxy(proxy_setting, exceptions)
      ENV['HTTP_PROXY'] = proxy_setting
      ENV['http_proxy'] = proxy_setting
      ENV['HTTPS_PROXY'] = proxy_setting
      ENV['https_proxy'] = proxy_setting
      ENV['NO_PROXY'] = exceptions
      ENV['no_proxy'] = exceptions
      true
    end
729635
public function setProxy($host = null, $port = null)
    {
        if (!$host) {
            $this->proxyHost = null;
            $this->proxyPort = null;
            return;
        }

        if (!is_string($host)) {
            throw new InvalidArgumentException('host expects a string, ' . gettype($host) . ' given.');
        }

        if (!is_int($port)) {
            throw new InvalidArgumentException('port expects an integer, ' . gettype($port) . ' given.');
        }

        $this->proxyHost = $host;
        $this->proxyPort = $port;
    }
162573
public function withSocks5(string $host, int $port, ?string $username, ?string $password): self
    {
        $this->proxy = [
            'socks5_host' => $host,
            'socks5_port' => $port,
            'socks5_username' => $username,
            'socks5_password' => $password,
        ];

        return $this;
    }
718277
public function setProxy(string $proxy): RequestContext
    {
        $this->assertValidUrl($proxy);

        $this->proxy = $proxy;

        return $this;
    }
390280
public static void setProxy(String host, String port) {
		System.setProperty(LOCAL_PROXY_HOST_PROPERTY, host);
		System.setProperty(LOCAL_PROXY_PORT_PROPERTY, port);
	}