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
A working prototype to support PROXY protocol v2 as described in
HAProxy Documentation.
This ServerProxyAcceptor
can process PROXY protocol v1 and v2.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
-
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 interfaceorg.apache.sshd.server.session.ServerProxyAcceptor
- Overrides:
acceptServerProxyMetadata
in classProxyProtocolAcceptor
- 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 classProxyProtocolAcceptor
- Throws:
Exception
-