Class ProxyProtocolV2Acceptor

  • All Implemented Interfaces:
    org.apache.sshd.server.session.ServerProxyAcceptor

    public class ProxyProtocolV2Acceptor
    extends ProxyProtocolAcceptor
    A working prototype to support PROXY protocol v2 as described in HAProxy Documentation.

    This ServerProxyAcceptor can process PROXY protocol v1 and v2.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean acceptServerProxyMetadata​(org.apache.sshd.server.session.ServerSession session, org.apache.sshd.common.util.buffer.Buffer buffer)  
      protected boolean parseProxyHeader​(org.apache.sshd.server.session.ServerSession session, java.lang.String proxyHeader, int markPosition, org.apache.sshd.common.util.buffer.Buffer buffer)  
      protected boolean readProxyV2Header​(org.apache.sshd.server.session.ServerSession session, int markPosition, org.apache.sshd.common.util.buffer.Buffer buffer)  
      • Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

        debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PROXY_V2_HEADER

        private static final byte[] PROXY_V2_HEADER
    • Constructor Detail

      • ProxyProtocolV2Acceptor

        public ProxyProtocolV2Acceptor()
    • Method Detail

      • acceptServerProxyMetadata

        public boolean acceptServerProxyMetadata​(org.apache.sshd.server.session.ServerSession session,
                                                 org.apache.sshd.common.util.buffer.Buffer buffer)
                                          throws java.lang.Exception
        Specified by:
        acceptServerProxyMetadata in interface org.apache.sshd.server.session.ServerProxyAcceptor
        Overrides:
        acceptServerProxyMetadata in class ProxyProtocolAcceptor
        Throws:
        java.lang.Exception
      • readProxyV2Header

        protected boolean readProxyV2Header​(org.apache.sshd.server.session.ServerSession session,
                                            int markPosition,
                                            org.apache.sshd.common.util.buffer.Buffer buffer)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseProxyHeader

        protected boolean parseProxyHeader​(org.apache.sshd.server.session.ServerSession session,
                                           java.lang.String proxyHeader,
                                           int markPosition,
                                           org.apache.sshd.common.util.buffer.Buffer buffer)
                                    throws java.lang.Exception
        Overrides:
        parseProxyHeader in class ProxyProtocolAcceptor
        Throws:
        java.lang.Exception