org.eclipse.jetty.client.HttpClient.getProxyConfiguration()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(196)

本文整理了Java中org.eclipse.jetty.client.HttpClient.getProxyConfiguration()方法的一些代码示例,展示了HttpClient.getProxyConfiguration()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpClient.getProxyConfiguration()方法的具体详情如下:
包路径:org.eclipse.jetty.client.HttpClient
类名称:HttpClient
方法名:getProxyConfiguration

HttpClient.getProxyConfiguration介绍

暂无

代码示例

代码示例来源:origin: jersey/jersey

if (proxyUri != null) {
  final URI u = getProxyUri(proxyUri);
  final ProxyConfiguration proxyConfig = client.getProxyConfiguration();
  proxyConfig.getProxies().add(new HttpProxy(u.getHost(), u.getPort()));

代码示例来源:origin: forcedotcom/EMP-Connector

public EmpConnector(BayeuxParameters parameters) {
  this.parameters = parameters;
  httpClient = new HttpClient(parameters.sslContextFactory());
  httpClient.getProxyConfiguration().getProxies().addAll(parameters.proxies());
}

代码示例来源:origin: forcedotcom/EMP-Connector

HttpClient client = new HttpClient(parameters.sslContextFactory());
try {
  client.getProxyConfiguration().getProxies().addAll(parameters.proxies());
  client.start();
  URL endpoint = new URL(loginEndpoint, getSoapUri());

代码示例来源:origin: io.digdag/digdag-standards

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);
    }
  }
}

代码示例来源:origin: openhab/openhab-core

ProxyConfiguration proxyConfig = httpClient.getProxyConfiguration();
List<Proxy> proxies = proxyConfig.getProxies();
if (proxy != null) {
  httpClient.getProxyConfiguration().getProxies().remove(proxy);

代码示例来源:origin: org.eclipse.smarthome.io/org.eclipse.smarthome.io.net

ProxyConfiguration proxyConfig = CLIENT.getProxyConfiguration();
List<Proxy> proxies = proxyConfig.getProxies();
if (proxy != null) {
  CLIENT.getProxyConfiguration().getProxies().remove(proxy);

代码示例来源:origin: org.glassfish.jersey.connectors/jersey-jetty-connector

if (proxyUri != null) {
  final URI u = getProxyUri(proxyUri);
  final ProxyConfiguration proxyConfig = client.getProxyConfiguration();
  proxyConfig.getProxies().add(new HttpProxy(u.getHost(), u.getPort()));

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

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);
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

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);
}

代码示例来源:origin: org.attribyte/attribyte-http

this.httpClient.setCookieStore(new HttpCookieStore.Empty());
if(options.proxyHost != null) {
 ProxyConfiguration proxyConfig = httpClient.getProxyConfiguration();
 proxyConfig.getProxies().add(new HttpProxy(options.proxyHost, options.proxyPort));

代码示例来源:origin: airlift/airlift

httpClient.getProxyConfiguration().getProxies().add(new Socks4Proxy(socksProxy.getHost(), socksProxy.getPortOrDefault(1080)));

代码示例来源:origin: com.proofpoint.platform/http-client

httpClient.getProxyConfiguration().getProxies().add(new Socks4Proxy(socksProxy.getHost(), socksProxy.getPortOrDefault(1080)));

代码示例来源:origin: org.eclipse.jetty/jetty-client

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);
}

相关文章

HttpClient类方法