Class HTTPProxyConfigurator


  • public class HTTPProxyConfigurator
    extends Object
    • Constructor Detail

      • HTTPProxyConfigurator

        public HTTPProxyConfigurator()
    • Method Detail

      • configure

        public static void configure​(MessageContext messageContext,
                                     org.apache.http.client.config.RequestConfig.Builder requestConfig,
                                     org.apache.http.client.protocol.HttpClientContext clientContext)
                              throws AxisFault
        Configure HTTP Proxy settings of httpcomponents HostConfiguration. Proxy settings can be get from axis2.xml, Java proxy settings or can be override through property in message context.

        HTTP Proxy setting element format: example.org 3128 EXAMPLE/John password

        Parameters:
        messageContext - in message context for
        requestConfig - the request configuration to fill in
        clientContext - the HTTP client context
        Throws:
        AxisFault - if Proxy settings are invalid
      • isProxyEnabled

        public static boolean isProxyEnabled​(MessageContext messageContext,
                                             URL targetURL)
        Check whether http proxy is configured or active. This is not a deep check.
        Parameters:
        messageContext - in message context
        targetURL - URL of the edpoint which we are sending the request
        Returns:
        true if proxy is enabled, false otherwise
      • isHostInNonProxyList

        public static boolean isHostInNonProxyList​(String host,
                                                   String nonProxyHosts)
        Check if the specified host is in the list of non proxy hosts.
        Parameters:
        host - host name
        nonProxyHosts - string containing the list of non proxy hosts
        Returns:
        true/false