Class ProxyAddress

All Implemented Interfaces:
SocketConnectable, Proxy

@Generated("org.javagi.JavaGI") public class ProxyAddress extends InetSocketAddress implements SocketConnectable
A InetSocketAddress representing a connection via a proxy server.
Since:
2.26
  • Constructor Details

    • ProxyAddress

      public ProxyAddress(MemorySegment address)
      Create a ProxyAddress instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • ProxyAddress

      public ProxyAddress(InetAddress inetaddr, short port, String protocol, String destHostname, short destPort, @Nullable String username, @Nullable String password)

      Creates a new GProxyAddress for inetaddr with protocol that should tunnel through destHostname and destPort.

      (Note that this method doesn't set the GProxyAddress:uri or GProxyAddress:destination-protocol fields; use g_object_new() directly if you want to set those.)

      Parameters:
      inetaddr - The proxy server GInetAddress.
      port - The proxy server port.
      protocol - The proxy protocol to support, in lower case (e.g. socks, http).
      destHostname - The destination hostname the proxy should tunnel to.
      destPort - The destination port to tunnel to.
      username - The username to authenticate to the proxy server (or null).
      password - The password to authenticate to the proxy server (or null).
      Since:
      2.26
    • ProxyAddress

      public ProxyAddress()
      Create a new ProxyAddress.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the ProxyAddress class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected ProxyAddress asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class InetSocketAddress
      Returns:
      the instance as if it were its parent type
    • getDestinationHostname

      public String getDestinationHostname()
      Gets proxy's destination hostname; that is, the name of the host that will be connected to via the proxy, not the name of the proxy itself.
      Returns:
      the proxy's destination hostname
      Since:
      2.26
    • getDestinationPort

      public short getDestinationPort()
      Gets proxy's destination port; that is, the port on the destination host that will be connected to via the proxy, not the port number of the proxy itself.
      Returns:
      the proxy's destination port
      Since:
      2.26
    • getDestinationProtocol

      public String getDestinationProtocol()
      Gets the protocol that is being spoken to the destination server; eg, "http" or "ftp".
      Returns:
      the proxy's destination protocol
      Since:
      2.34
    • getPassword

      public @Nullable String getPassword()
      Gets proxy's password.
      Returns:
      the proxy's password
      Since:
      2.26
    • getProtocol

      public String getProtocol()
      Gets proxy's protocol. eg, "socks" or "http"
      Returns:
      the proxy's protocol
      Since:
      2.26
    • getUri

      public @Nullable String getUri()
      Gets the proxy URI that this ProxyAddress was constructed from.
      Returns:
      the proxy's URI, or null if unknown
      Since:
      2.34
    • getUsername

      public @Nullable String getUsername()
      Gets proxy's username.
      Returns:
      the proxy's username
      Since:
      2.26
    • builder

      public static ProxyAddress.Builder<? extends ProxyAddress.Builder> builder()
      A ProxyAddress.Builder object constructs a ProxyAddress with the specified properties. Use the various set...() methods to set properties, and finish construction with ProxyAddress.Builder.build().
      Returns:
      the builder object