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 charprivate static final byte[]Fields inherited from class ProxyProtocolAcceptor
MAX_PROXY_HEADER_LENGTH, PROX_PROTOCOL_PREFIXFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptServerProxyMetadata(org.apache.sshd.server.session.ServerSession session, org.apache.sshd.common.util.buffer.Buffer buffer) protected booleanparseProxyHeader(org.apache.sshd.server.session.ServerSession session, String proxyHeader, int markPosition, org.apache.sshd.common.util.buffer.Buffer buffer) protected booleanreadProxyV2Header(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:
acceptServerProxyMetadatain interfaceorg.apache.sshd.server.session.ServerProxyAcceptor- Overrides:
acceptServerProxyMetadatain classProxyProtocolAcceptor- Throws:
Exception
-
readProxyV2Header
-
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:
parseProxyHeaderin classProxyProtocolAcceptor- Throws:
Exception
-