Package org.takes.rq

Class RqSocket

  • All Implemented Interfaces:
    Body, Head, Request

    public final class RqSocket
    extends RqWrap
    Request decorator to get custom socket headers.

    The class is immutable and thread-safe.

    Since:
    1.0
    • Constructor Detail

      • RqSocket

        public RqSocket​(Request req)
        Ctor.
        Parameters:
        req - Original request
    • Method Detail

      • getLocalAddress

        public InetAddress getLocalAddress()
                                    throws IOException
        Returns IP address from the X-Takes-LocalAddress header.
        Returns:
        Local InetAddress
        Throws:
        IOException - If fails
      • getRemoteAddress

        public InetAddress getRemoteAddress()
                                     throws IOException
        Returns IP address from the X-Takes-RemoteAddress header.
        Returns:
        Remote InetAddress
        Throws:
        IOException - If fails
      • getLocalPort

        public int getLocalPort()
                         throws IOException
        Returns port from the X-Takes-LocalPort header.
        Returns:
        Local Port
        Throws:
        IOException - If fails
      • getRemotePort

        public int getRemotePort()
                          throws IOException
        Returns port from the X-Takes-RemotePort header.
        Returns:
        Remote Port
        Throws:
        IOException - If fails