HttpProxy

Inheritance: java.lang.Object, com.aspose.email.Proxy

All Implemented Interfaces: com.aspose.ms.System.Net.IWebProxy

public class HttpProxy extends Proxy implements System.Net.IWebProxy

HTTP proxy client.

Constructors

ConstructorDescription
HttpProxy(String address, int port)Initializes a new instance of the HttpProxy class to connect to proxy server without authentication.
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.

Methods

MethodDescription
dispose()Disposes this instance and requests that the underlying TCP connection be closed.
equals(Object arg0)
getAddress()The domain name or IP address of the proxy server
getClass()
getCredentials()The credentials to submit to the proxy server for authentication.
getPassword()Password for proxy authentication
getPort()The port number for the proxy server
getProxy(System.Uri destination)
getProxy(URI destination)Returns the URI of a proxy.
getStream(String address, int port)Returns configured network stream to transport data to the required host through the proxy server.
getSupportedAuthenticationMethods()The supported authentication methods to connect to HTTP proxy
getUsername()Username for proxy authentication
hashCode()
isBypassed(System.Uri host)
isBypassed(URI host)Indicates that the proxy should not be used for the specified host.
notify()
notifyAll()
setAddress(String value)The domain name or IP address of the proxy server
setCredentials(System.Net.ICredentials value)The credentials to submit to the proxy server for authentication.
setPassword(String value)Password for proxy authentication
setPort(int value)The port number for the proxy server
setSupportedAuthenticationMethods(byte value)The supported authentication methods to connect to HTTP proxy
setUpStream(System.IO.Stream stream, String address, int port)Configures proxy-server to transport data to the target host.
setUsername(String value)Username for proxy authentication
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

HttpProxy(String address, int port)

public HttpProxy(String address, int port)

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

Parameters:

ParameterTypeDescription
addressjava.lang.StringThe domain name or IP address of the proxy
portintThe port number of the proxy

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

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:

ParameterTypeDescription
addressjava.lang.StringThe domain name or IP address of the proxy
portintThe port number of the proxy
usernamejava.lang.StringUsername for authentication
passwordjava.lang.StringPassword for authentication

dispose()

public void dispose()

Disposes this instance and requests that the underlying TCP connection be closed.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAddress()

public final String getAddress()

The domain name or IP address of the proxy server

Returns: java.lang.String

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCredentials()

public final System.Net.ICredentials getCredentials()

The credentials to submit to the proxy server for authentication.

Returns: com.aspose.ms.System.Net.ICredentials

getPassword()

public final String getPassword()

Password for proxy authentication

Returns: java.lang.String

getPort()

public final int getPort()

The port number for the proxy server

Returns: int

getProxy(System.Uri destination)

public System.Uri getProxy(System.Uri destination)

Parameters:

ParameterTypeDescription
destinationcom.aspose.ms.System.Uri

Returns: com.aspose.ms.System.Uri

getProxy(URI destination)

public URI getProxy(URI destination)

Returns the URI of a proxy.

Parameters:

ParameterTypeDescription
destinationjava.net.URIA System.Uri that specifies the requested Internet resource.

Returns: java.net.URI - A System.Uri instance that contains the URI of the proxy used to contact destination.

getStream(String address, int port)

public System.IO.Stream getStream(String address, int port)

Returns configured network stream to transport data to the required host through the proxy server.

Parameters:

ParameterTypeDescription
addressjava.lang.StringThe domain name of the host we want to contact
portintThe port number of the host we want to contact

Returns: com.aspose.ms.System.IO.Stream - Returns configure network stream to connect with required host through the proxy server.

getSupportedAuthenticationMethods()

public final byte getSupportedAuthenticationMethods()

The supported authentication methods to connect to HTTP proxy

Returns: byte

getUsername()

public final String getUsername()

Username for proxy authentication

Returns: java.lang.String

hashCode()

public native int hashCode()

Returns: int

isBypassed(System.Uri host)

public boolean isBypassed(System.Uri host)

Parameters:

ParameterTypeDescription
hostcom.aspose.ms.System.Uri

Returns: boolean

isBypassed(URI host)

public boolean isBypassed(URI host)

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

Parameters:

ParameterTypeDescription
hostjava.net.URIThe System.Uri of the host to check for proxy use.

Returns: boolean - true if the proxy server should not be used for host; otherwise, false.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAddress(String value)

public final void setAddress(String value)

The domain name or IP address of the proxy server

Parameters:

ParameterTypeDescription
valuejava.lang.String

setCredentials(System.Net.ICredentials value)

public final void setCredentials(System.Net.ICredentials value)

The credentials to submit to the proxy server for authentication.

Parameters:

ParameterTypeDescription
valuecom.aspose.ms.System.Net.ICredentials

setPassword(String value)

public final void setPassword(String value)

Password for proxy authentication

Parameters:

ParameterTypeDescription
valuejava.lang.String

setPort(int value)

public final void setPort(int value)

The port number for the proxy server

Parameters:

ParameterTypeDescription
valueint

setSupportedAuthenticationMethods(byte value)

public final void setSupportedAuthenticationMethods(byte value)

The supported authentication methods to connect to HTTP proxy

Parameters:

ParameterTypeDescription
valuebyte

setUpStream(System.IO.Stream stream, String address, int port)

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

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

Parameters:

ParameterTypeDescription
streamcom.aspose.ms.System.IO.StreamStream which is connected to the proxy-server.
addressjava.lang.StringThe network address of the target host we want to contact
portintThe port number of the target host we want to contact

setUsername(String value)

public final void setUsername(String value)

Username for proxy authentication

Parameters:

ParameterTypeDescription
valuejava.lang.String

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int