Configure the proxy.
764639
public function proxy(
        array $ips = [],
        array $headers = [
            'Forwarded',
            'Forwarded-For',
            'X-Forwarded',
            'X-Forwarded-For',
            'X-Cluster-Client-Ip',
            'Client-Ip',
        ]
    ): self {
        $this->proxyIps = $ips;
        $this->proxyHeaders = $headers;

        return $this;
    }
1037833
public void setProxy(String host, int port, String user, String pwd) {
		this.proxy = new Proxy(host, port, user, pwd);
	}
748253
public static void applyProxy(Proxy use) {
    System.setProperty("java.net.useSystemProxies", "false");
    System.setProperty("http.proxyHost", use.getIp());
    System.setProperty("http.proxyPort", String.valueOf(use.getPort()));
    System.setProperty("https.proxyHost", use.getIp());
    System.setProperty("https.proxyPort", String.valueOf(use.getPort()));
  }
749981
def proxy(ctx, bind, port):
    
    app = web.Application()
    app.on_startup.append(startup_proxy)
    app.on_cleanup.append(cleanup_proxy)

    app.router.add_route("GET", r'/stream/{path:.*$}', websocket_handler)
    app.router.add_route("GET", r'/wsproxy/{path:.*$}', websocket_handler)
    app.router.add_route('*', r'/{path:.*$}', web_handler)
    if getattr(ctx.args, 'testing', False):
        return app
    web.run_app(app, host=bind, port=port)
488053
function setProxy($proxyHost, $proxyPort) {
      $this->useProxy = true;
      $this->proxyHost = $proxyHost;
      $this->proxyPort = $proxyPort;
    }
940460
protected function registerProxies() {

		Proxy::setContainer( $this );

		foreach ( $this->proxies as $class => $alias ) {
			class_alias( $class, $alias );
		}
	}
123096
function setupForCorporateProxy(proxyConfig) {
  if (!Array.isArray(proxyConfig)) {
    proxyConfig = [proxyConfig];
  }

  const proxyServer = process.env.http_proxy || process.env.HTTP_PROXY;
  let agent = null;

  if (proxyServer) {
    console.log(`Using corporate proxy server: ${proxyServer}`);
    agent = new HttpsProxyAgent(proxyServer);
    proxyConfig.forEach(entry => { entry.agent = agent; });
  }

  return proxyConfig;
}
512094
public static void configureCustomProxyProperties(
      Map<SFSessionProperty, Object> connectionPropertiesMap)
  {
    if (connectionPropertiesMap.containsKey(SFSessionProperty.USE_PROXY))
    {
      useProxy = (boolean) connectionPropertiesMap.get(
          SFSessionProperty.USE_PROXY);
    }

    if (useProxy)
    {
      proxyHost =
          (String) connectionPropertiesMap.get(SFSessionProperty.PROXY_HOST);
      proxyPort =
          Integer.parseInt(
              connectionPropertiesMap.get(SFSessionProperty.PROXY_PORT).toString());
      proxyUser =
          (String) connectionPropertiesMap.get(SFSessionProperty.PROXY_USER);
      proxyPassword =
          (String) connectionPropertiesMap.get(SFSessionProperty.PROXY_PASSWORD);
      nonProxyHosts =
          (String) connectionPropertiesMap.get(SFSessionProperty.NON_PROXY_HOSTS);
    }
  }
1350372
public void setProxy(String proxyHost, int proxyPort) {
        System.setProperty("http.proxySet", "true");
        System.setProperty("http.proxyHost", proxyHost);
        System.setProperty("http.proxyPort", "" + proxyPort);
        System.setProperty("https.proxyHost", proxyHost);
        System.setProperty("https.proxyPort", "" + proxyPort);
    }
1258508
def prepare(self):
        '''
        
        '''
        super(ProxyMinion, self).prepare()

        if not self.values.proxyid:
            self.error('salt-proxy requires --proxyid')

        # Proxies get their ID from the command line.  This may need to change in
        # the future.
        # We used to set this here.  Now it is set in ProxyMinionOptionParser
        # by passing it via setup_config to config.minion_config
        # self.config['id'] = self.values.proxyid

        try:
            if self.config['verify_env']:
                confd = self.config.get('default_include')
                if confd:
                    # If 'default_include' is specified in config, then use it
                    if '*' in confd:
                        # Value is of the form "minion.d/*.conf"
                        confd = os.path.dirname(confd)
                    if not os.path.isabs(confd):
                        # If configured 'default_include' is not an absolute
                        # path, consider it relative to folder of 'conf_file'
                        # (/etc/salt by default)
                        confd = os.path.join(
                            os.path.dirname(self.config['conf_file']), confd
                        )
                else:
                    confd = os.path.join(
                        os.path.dirname(self.config['conf_file']), 'proxy.d'
                    )

                v_dirs = [
                    self.config['pki_dir'],
                    self.config['cachedir'],
                    self.config['sock_dir'],
                    self.config['extension_modules'],
                    confd,
                ]

                verify_env(
                    v_dirs,
                    self.config['user'],
                    permissive=self.config['permissive_pki_access'],
                    root_dir=self.config['root_dir'],
                    pki_dir=self.config['pki_dir'],
                )
        except OSError as error:
            self.environment_failure(error)

        self.setup_logfile_logger()
        verify_log(self.config)
        self.action_log_info('Setting up "{0}"'.format(self.config['id']))

        migrations.migrate_paths(self.config)

        # Bail out if we find a process running and it matches out pidfile
        if self.check_running():
            self.action_log_info('An instance is already running. Exiting')
            self.shutdown(1)

        # TODO: AIO core is separate from transport
        # Late import so logging works correctly
        import salt.minion
        # If the minion key has not been accepted, then Salt enters a loop
        # waiting for it, if we daemonize later then the minion could halt
        # the boot process waiting for a key to be accepted on the master.
        # This is the latest safe place to daemonize
        self.daemonize_if_required()
        self.set_pidfile()
        if self.config.get('master_type') == 'func':
            salt.minion.eval_master_func(self.config)
        self.minion = salt.minion.ProxyMinionManager(self.config)
791007
protected function proxy() {
        if (!$this->context) {
            $this->context = new ConfigurationContext($this->version);
        }

        return $this->context;
    }
552124
def from_dict(config):
        '''
        
        '''
        return ProxyConfig(
            http=config.get('httpProxy'),
            https=config.get('httpsProxy'),
            ftp=config.get('ftpProxy'),
            no_proxy=config.get('noProxy'),
        )
168851
def proxy_manager_for(self, proxy, **proxy_kwargs):
        """"""
        try:
            proxy_kwargs['ssl_version'] = ssl.PROTOCOL_TLS
        except AttributeError:
            proxy_kwargs['ssl_version'] = ssl.PROTOCOL_SSLv23
        return super(SSLAdapter, self).proxy_manager_for(proxy, **proxy_kwargs)
889807
def setProxy(self, protocol="http"):
        
        # Setting proxy
        try:
            new = { protocol: self.proxies[protocol]}
            self.br.set_proxies( new )
        except:
            # No proxy defined for that protocol
            pass
486576
def _prepare_proxy(self, conn):
        
        # Python 2.7+
        try:
            set_tunnel = conn.set_tunnel
        except AttributeError:  # Platform-specific: Python 2.6
            set_tunnel = conn._set_tunnel

        if sys.version_info <= (2, 6, 4) and not self.proxy_headers:  # Python 2.6.4 and older
            set_tunnel(self._proxy_host, self.port)
        else:
            set_tunnel(self._proxy_host, self.port, self.proxy_headers)

        conn.connect()
871804
def set_proxy(proxy_url, transport_proxy=None):
    """"""
    global proxy, PYPI_URL
    PYPI_URL = proxy_url
    proxy = xmlrpc.ServerProxy(
        proxy_url,
        transport=RequestsTransport(proxy_url.startswith('https://')),
        allow_none=True)
889217
protected function configureEgressProxy()
    {
        if (!Environment::getEnv('SS_OUTBOUND_PROXY')
            || !Environment::getEnv('SS_OUTBOUND_PROXY_PORT')
        ) {
            return;
        }

        $proxy = Environment::getEnv('SS_OUTBOUND_PROXY');
        $proxyPort = Environment::getEnv('SS_OUTBOUND_PROXY_PORT');

        /*
         * This sets the environment variables so they are available in
         * external calls executed by exec() such as curl.
         * Environment::setEnv() would only availabe in context of SilverStripe.
         * Environment::getEnv() will fallback to getenv() and will therefore
         * fetch the variables
         */
        putenv('http_proxy=' .  $proxy . ':' . $proxyPort);
        putenv('https_proxy=' . $proxy . ':' . $proxyPort);
    }