Class ProxyProtocolV2Acceptor

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.contrib.server.session.proxyprotocol.ProxyProtocolAcceptor
org.apache.sshd.contrib.server.session.proxyprotocolv2.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.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final char
     
    private static final byte[]
     

    Fields inherited from class org.apache.sshd.contrib.server.session.proxyprotocol.ProxyProtocolAcceptor

    MAX_PROXY_HEADER_LENGTH, PROX_PROTOCOL_PREFIX

    Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

    log
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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, 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 Details

    • PROXY_V2_HEADER

      private static final byte[] PROXY_V2_HEADER
    • FIELD_SEPARATOR

      private static final char FIELD_SEPARATOR
      See Also:
  • Constructor Details

    • ProxyProtocolV2Acceptor

      public ProxyProtocolV2Acceptor()
  • Method Details

    • acceptServerProxyMetadata

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

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

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