Interface ProxyConfig<A>

Type Parameters:
A - the type of address

public interface ProxyConfig<A>
Configuration for a proxy.
  • Method Details

    • address

      A address()
      Address of the proxy.

      Usually, this is an unresolved proxy address and its type must match the type of address before resolution used by SingleAddressHttpClientBuilder. However, if the client builder was created for a resolved address, this address must also be already resolved. Otherwise, a runtime exception will occur.

      Returns:
      address of the proxy
    • connectRequestHeadersInitializer

      Consumer<HttpHeaders> connectRequestHeadersInitializer()
      An initializer for HttpHeaders related to HTTP/1.1 CONNECT request.

      When this ProxyConfig is used for secure proxy tunnels (when ClientSslConfig is configured) the tunnel is always initialized using HTTP/1.1 CONNECT request. This Consumer can be used to set custom HttpHeaders for that request, like proxy-authorization, tracing, or any other header.

      Returns:
      An initializer for HttpHeaders related to HTTP/1.1 CONNECT request
    • forAddress

      static <A> ProxyConfig<A> forAddress(A address)
      Returns a ProxyConfig for the specified address.

      All other ProxyConfig options will use their default values applied by ProxyConfigBuilder.

      Type Parameters:
      A - the type of address
      Parameters:
      address - Address of the proxy
      Returns:
      a ProxyConfig for the specified address
      See Also: