Top Description Methods
org.apache.sshd.server.session

public Interface ServerProxyAcceptor

Annotations
@FunctionalInterface
Imports
org.apache.sshd.common.util.buffer.Buffer

Provides a way to implement proxied connections where some metadata about the client is sent before the actual SSH protocol is executed - e.g., the PROXY protocol.
Author
Apache MINA SSHD Project

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if successfully extracted the remote client peer meta-data, false if more data is required. Upon successful return the buffer read position is assumed to indicate the first character of the SSH identification line
acceptServerProxyMetadata
(ServerSession
The ServerSession instance
session
,
Buffer
The received data Buffer - if not the 1st time this method is called because data was lacking on last invocation, then the buffer is guaranteed to contain the data from all the previous incomplete invocations plus any new received data. If not enough information is available, the buffer's read position should be restored to its original value when the method was invoked.
buffer
)

Invoked before any attempt is made to retrieve the SSH client identification data of the standard SSH protocol.

Method Detail

acceptServerProxyMetadataback to summary
public boolean acceptServerProxyMetadata(ServerSession session, Buffer buffer) throws Exception

Invoked before any attempt is made to retrieve the SSH client identification data of the standard SSH protocol. The implementor should extract whatever data it needs from the data buffer

Note

the method may be called several times for the same session even though the original proxy data was successfully extracted. This happens in case the client identification line following it is incomplete and thus requires waiting for more incoming packets.

Parameters
session:ServerSession

The ServerSession instance

buffer:Buffer

The received data Buffer - if not the 1st time this method is called because data was lacking on last invocation, then the buffer is guaranteed to contain the data from all the previous incomplete invocations plus any new received data. If not enough information is available, the buffer's read position should be restored to its original value when the method was invoked.

Returns:boolean

true if successfully extracted the remote client peer meta-data, false if more data is required. Upon successful return the buffer read position is assumed to indicate the first character of the SSH identification line

Exceptions
Exception:
If failed to correctly extract and parse the meta-data, in which case the session will be closed