com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class SocksProxy

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable


    public class SocksProxy
    extends Proxy

    SOCKS proxy client. Supported versions of the protocol are SOCKS4 and SOCKS5.

    • Constructor Detail

      • SocksProxy

        public SocksProxy(String address,
                  int port)

        Initializes a new instance of the SocksProxy class to connect to SOCKS4 server without authentication.

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

        public SocksProxy(String address,
                  int port,
                  byte version)

        Initializes a new instance of the SocksProxy class to connect to SOCKS4 or SOCKS5 server without authentication.

        Parameters:
        address - The domain name or IP address of the proxy
        port - The port number of the proxy
        version - Required SOCKS server version.
      • SocksProxy

        public SocksProxy(String address,
                  int port,
                  String userID)

        Initializes a new instance of the SocksProxy class to connect to SOCKS4 server without authentication.

        Parameters:
        address - The domain name or IP address of the proxy
        port - The port number of the proxy
        userID - UserID for Socks4 Identification Protocol (RFC 1413)
      • SocksProxy

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

        Initializes a new instance of the SocksProxy class to connect to SOCKS5 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

      • getVersion

        public final byte getVersion()

        Required SOCKS server version.

      • setVersion

        public final void setVersion(byte value)

        Required SOCKS server version.

      • getSupportedAuthenticationMethods

        public final byte getSupportedAuthenticationMethods()

        The supported authentication methods to connect to SOCKS server

      • setSupportedAuthenticationMethods

        public final void setSupportedAuthenticationMethods(byte value)

        The supported authentication methods to connect to SOCKS server

      • setUpStream

        public void setUpStream(com.aspose.ms.System.IO.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