if (proxyUri != null) { final URI u = getProxyUri(proxyUri); final ProxyConfiguration proxyConfig = client.getProxyConfiguration(); proxyConfig.getProxies().add(new HttpProxy(u.getHost(), u.getPort()));
public EmpConnector(BayeuxParameters parameters) { this.parameters = parameters; httpClient = new HttpClient(parameters.sslContextFactory()); httpClient.getProxyConfiguration().getProxies().addAll(parameters.proxies()); }
HttpClient client = new HttpClient(parameters.sslContextFactory()); try { client.getProxyConfiguration().getProxies().addAll(parameters.proxies()); client.start(); URL endpoint = new URL(loginEndpoint, getSoapUri());
private void configureProxy(HttpClient httpClient) { List<ProxyConfiguration.Proxy> proxies = httpClient.getProxyConfiguration().getProxies(); Config userProxyConfig = params.getNestedOrGetEmpty("proxy"); boolean userProxyEnabled = userProxyConfig.get("enabled", boolean.class, false); if (allowUserProxy && userProxyEnabled) { String host = userProxyConfig.get("host", String.class); int port = userProxyConfig.get("port", int.class); boolean tls = userProxyConfig.get("tls", boolean.class, false); proxies.add(new HttpProxy(new Origin.Address(host, port), tls)); } else { if (systemProxy.isPresent()) { proxies.add(systemProxy.get()); } else { configureEnvProxy("http", proxies); configureEnvProxy("https", proxies); } } }
ProxyConfiguration proxyConfig = httpClient.getProxyConfiguration(); List<Proxy> proxies = proxyConfig.getProxies(); if (proxy != null) { httpClient.getProxyConfiguration().getProxies().remove(proxy);
ProxyConfiguration proxyConfig = CLIENT.getProxyConfiguration(); List<Proxy> proxies = proxyConfig.getProxies(); if (proxy != null) { CLIENT.getProxyConfiguration().getProxies().remove(proxy);
if (proxyUri != null) { final URI u = getProxyUri(proxyUri); final ProxyConfiguration proxyConfig = client.getProxyConfiguration(); proxyConfig.getProxies().add(new HttpProxy(u.getHost(), u.getPort()));
public HttpDestination(HttpClient client, String scheme, String host, int port) { this.client = client; this.scheme = scheme; this.host = host; this.address = new Address(host, port); int maxRequestsQueued = client.getMaxRequestsQueuedPerDestination(); int capacity = Math.min(32, maxRequestsQueued); this.exchanges = new BlockingArrayQueue<>(capacity, capacity, maxRequestsQueued); int maxConnections = client.getMaxConnectionsPerDestination(); capacity = Math.min(8, maxConnections); this.idleConnections = new BlockingArrayQueue<>(capacity, capacity, maxConnections); this.activeConnections = new BlockingArrayQueue<>(capacity, capacity, maxConnections); this.requestNotifier = new RequestNotifier(client); this.responseNotifier = new ResponseNotifier(client); ProxyConfiguration proxyConfig = client.getProxyConfiguration(); proxyAddress = proxyConfig != null && proxyConfig.matches(host, port) ? new Address(proxyConfig.getHost(), proxyConfig.getPort()) : null; hostField = new HttpField(HttpHeader.HOST, host + ":" + port); }
public HttpDestination(HttpClient client, String scheme, String host, int port) { this.client = client; this.scheme = scheme; this.host = host; this.address = new Address(host, port); int maxRequestsQueued = client.getMaxRequestsQueuedPerDestination(); int capacity = Math.min(32, maxRequestsQueued); this.exchanges = new BlockingArrayQueue<>(capacity, capacity, maxRequestsQueued); int maxConnections = client.getMaxConnectionsPerDestination(); capacity = Math.min(8, maxConnections); this.idleConnections = new BlockingArrayQueue<>(capacity, capacity, maxConnections); this.activeConnections = new BlockingArrayQueue<>(capacity, capacity, maxConnections); this.requestNotifier = new RequestNotifier(client); this.responseNotifier = new ResponseNotifier(client); ProxyConfiguration proxyConfig = client.getProxyConfiguration(); proxyAddress = proxyConfig != null && proxyConfig.matches(host, port) ? new Address(proxyConfig.getHost(), proxyConfig.getPort()) : null; hostField = new HttpField(HttpHeader.HOST, host + ":" + port); }
this.httpClient.setCookieStore(new HttpCookieStore.Empty()); if(options.proxyHost != null) { ProxyConfiguration proxyConfig = httpClient.getProxyConfiguration(); proxyConfig.getProxies().add(new HttpProxy(options.proxyHost, options.proxyPort));
httpClient.getProxyConfiguration().getProxies().add(new Socks4Proxy(socksProxy.getHost(), socksProxy.getPortOrDefault(1080)));
httpClient.getProxyConfiguration().getProxies().add(new Socks4Proxy(socksProxy.getHost(), socksProxy.getPortOrDefault(1080)));
public HttpDestination(HttpClient client, Origin origin) { this.client = client; this.origin = origin; this.exchanges = newExchangeQueue(client); this.requestNotifier = new RequestNotifier(client); this.responseNotifier = new ResponseNotifier(); this.timeout = new TimeoutTask(client.getScheduler()); ProxyConfiguration proxyConfig = client.getProxyConfiguration(); proxy = proxyConfig.match(origin); ClientConnectionFactory connectionFactory = client.getTransport(); if (proxy != null) { connectionFactory = proxy.newClientConnectionFactory(connectionFactory); if (proxy.isSecure()) connectionFactory = newSslClientConnectionFactory(connectionFactory); } else { if (isSecure()) connectionFactory = newSslClientConnectionFactory(connectionFactory); } this.connectionFactory = connectionFactory; String host = HostPort.normalizeHost(getHost()); if (!client.isDefaultPort(getScheme(), getPort())) host += ":" + getPort(); hostField = new HttpField(HttpHeader.HOST, host); }