Interface ProxySpec


  • public interface ProxySpec
    Class for specifying configuration for an HTTP proxy to utilize for outgoing requests using HttpClient.
    Since:
    1.8.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      ProxySpec credentials​(java.lang.String username, java.lang.String password)
      Configure the username and password to use when connecting to the proxy.
      ProxySpec host​(java.lang.String host)
      Configure the host that will proxy outbound HTTP requests.
      ProxySpec nonProxyHosts​(java.util.Collection<java.lang.String> nonProxyHosts)
      Configure a collection of patterns for which if any are matched, the outbound request will bypass the HTTP proxy.
      ProxySpec port​(int port)
      Configure the port on the proxy to will outbound HTTP requests will be sent.
      ProxySpec protocol​(Proxy.ProxyProtocol protocol)
      The protocol to use when connecting to the proxy.
    • Method Detail

      • protocol

        ProxySpec protocol​(Proxy.ProxyProtocol protocol)
        The protocol to use when connecting to the proxy. Defaults to HTTP.
        Parameters:
        protocol - the protocol to use when connecting to the proxy
        Returns:
        this
      • host

        ProxySpec host​(java.lang.String host)
        Configure the host that will proxy outbound HTTP requests.
        Parameters:
        host - the host name for the HTTP proxy
        Returns:
        this
      • port

        ProxySpec port​(int port)
        Configure the port on the proxy to will outbound HTTP requests will be sent.
        Parameters:
        port - the port for the HTTP proxy
        Returns:
        this
      • credentials

        ProxySpec credentials​(java.lang.String username,
                              java.lang.String password)
        Configure the username and password to use when connecting to the proxy.
        Parameters:
        username - the username to use when connecting to the HTTP proxy
        password - the password to use when connecting to the HTTP proxy
        Returns:
        this
      • nonProxyHosts

        ProxySpec nonProxyHosts​(java.util.Collection<java.lang.String> nonProxyHosts)
        Configure a collection of patterns for which if any are matched, the outbound request will bypass the HTTP proxy.

        The format of the values in this list follow the standard Java Networking and Proxies standards

        Parameters:
        nonProxyHosts - a list of patterns to match the destination host
        Returns:
        this