@SuppressWarnings("UnusedReturnValue") ResteasyClientBuilder defaultProxy(String hostname, int port, final String scheme, String username, String password) { super.defaultProxy(hostname, port, scheme); if (username != null && password != null) { proxyCredentials = new BasicCredentialsProvider(); proxyCredentials.setCredentials(new AuthScope(hostname, port), new UsernamePasswordCredentials(username, password)); } return this; }
actualClient = this.builderDelegate.defaultProxy( proxyHost, Integer.parseInt(System.getProperty("http.proxyPort", "80")))
/** * Specify a default proxy. Default port and schema will be used * * @param hostname * @return */ public ResteasyClientBuilder defaultProxy(String hostname) { return defaultProxy(hostname, -1, null); }
/** * Specify a default proxy. Default port and schema will be used. * * @param hostname host name * @return an updated client builder instance */ public ResteasyClientBuilder defaultProxy(String hostname) { return defaultProxy(hostname, -1, null); }
/** * Specify a default proxy host and port. Default schema will be used. * * @param hostname host name * @param port port * @return an updated client builder instance */ public ResteasyClientBuilder defaultProxy(String hostname, int port) { return defaultProxy(hostname, port, null); }
/** * Specify a default proxy host and port. Default schema will be used * * @param hostname * @param port * @return */ public ResteasyClientBuilder defaultProxy(String hostname, int port) { return defaultProxy(hostname, port, null); }
public static ResteasyClient newResteasyClient() { LOGGER.debug("Creating RESTEasy client."); final Settings settings = Settings.INSTANCE; final long socketTimeout = settings.getSocketTimeout().toMillis(); LOGGER.debug("Set socket timeout to {} ms.", socketTimeout); final long connectionTimeout = settings.getConnectionTimeout().toMillis(); LOGGER.debug("Set connection timeout to {} ms.", connectionTimeout); final ResteasyClientBuilder builder = new ResteasyClientBuilder() .readTimeout(socketTimeout, TimeUnit.MILLISECONDS) .connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS); // setup HTTP proxy when required settings.getHttpsProxyHostname().ifPresent(host -> { final int port = settings.getHttpsProxyPort(); builder.defaultProxy(host, port); LOGGER.debug("Set HTTP proxy to {}:{}.", host, port); }); return builder.build(); }
public static ResteasyClient newResteasyClient() { LOGGER.debug("Creating RESTEasy client."); final Settings settings = Settings.INSTANCE; final long socketTimeout = settings.getSocketTimeout().toMillis(); LOGGER.debug("Set socket timeout to {} ms.", socketTimeout); final long connectionTimeout = settings.getConnectionTimeout().toMillis(); LOGGER.debug("Set connection timeout to {} ms.", connectionTimeout); // Supply the provider factory singleton, as otherwise RESTEasy would create a new instance every time. final ResteasyClientBuilder builder = new ResteasyClientBuilder() .providerFactory(ResteasyProviderFactory.getInstance()) .readTimeout(socketTimeout, TimeUnit.MILLISECONDS) .connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS); // setup HTTP proxy when required settings.getHttpsProxyHostname().ifPresent(host -> { final int port = settings.getHttpsProxyPort(); builder.defaultProxy(host, port); LOGGER.debug("Set HTTP proxy to {}:{}.", host, port); }); return builder.build(); }
protected ResteasyClient createClient() { return new ResteasyClientBuilder() .defaultProxy(getHttpHost(), getHttpPort()) .build(); }
ResteasyClient client = builder.defaultProxy(hostName, port, scheme).build();
client = this.builderDelegate.defaultProxy( proxyHost, Integer.parseInt(System.getProperty("http.proxyPort", "80")))
if (proxyHost != null && !noProxyHosts.contains(baseURI.getHost())) { resteasyClientBuilder = this.builderDelegate.defaultProxy( proxyHost, Integer.parseInt(System.getProperty("http.proxyPort", "80")));
actualClient = this.builderDelegate.defaultProxy( proxyHost, Integer.parseInt(System.getProperty("http.proxyPort", "80")))