com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class HttpProxy

  • All Implemented Interfaces:
    IDisposable, IWebProxy


    public class HttpProxy
    extends Proxy
    implements IWebProxy

    HTTP proxy client.

    • Constructor Detail

      • HttpProxy

        public HttpProxy(String address,
                 int port)

        Initializes a new instance of the HttpProxy class to connect to proxy server without authentication.

        Parameters:
        address - The domain name or IP address of the proxy
        port - The port number of the proxy
      • HttpProxy

        public HttpProxy(String address,
                 int port,
                 String username,
                 String password)

        Initializes a new instance of the HttpProxy class to connect to proxy server with defined username and password.

        Parameters:
        address - The domain name or IP address of the proxy
        port - The port number of the proxy
        username - Username for authentication
        password - Password for authentication
    • Method Detail

      • getSupportedAuthenticationMethods

        public final byte getSupportedAuthenticationMethods()

        The supported authentication methods to connect to HTTP proxy

      • setSupportedAuthenticationMethods

        public final void setSupportedAuthenticationMethods(byte value)

        The supported authentication methods to connect to HTTP proxy

      • setUpStream

        public void setUpStream(Stream stream,
                       String address,
                       int port)

        Configures proxy-server to transport data to the target host.

        Parameters:
        stream - Stream which is connected to the proxy-server.
        address - The network address of the target host we want to contact
        port - The port number of the target host we want to contact
      • getCredentials

        public final ICredentials getCredentials()

        The credentials to submit to the proxy server for authentication.

        Specified by:
        getCredentials in interface IWebProxy
      • setCredentials

        public final void setCredentials(ICredentials value)

        The credentials to submit to the proxy server for authentication.

        Specified by:
        setCredentials in interface IWebProxy
      • isBypassed

        public boolean isBypassed(URI host)

        Indicates that the proxy should not be used for the specified host.

        Parameters:
        host - The System.Uri of the host to check for proxy use.
        Returns:
        true if the proxy server should not be used for host; otherwise, false.
      • getProxy

        public URI getProxy(URI destination)

        Returns the URI of a proxy.

        Parameters:
        destination - A System.Uri that specifies the requested Internet resource.
        Returns:
        A System.Uri instance that contains the URI of the proxy used to contact destination.
      • getProxy

        public Uri getProxy(Uri destination)
        Specified by:
        getProxy in interface IWebProxy
      • isBypassed

        public boolean isBypassed(Uri host)
        Specified by:
        isBypassed in interface IWebProxy