Interface ConnectionListener


public interface ConnectionListener
This interface provides callback methods that are invoked when the client connection is first established, before any TLS or HTTP application traffic is sent. This can be used for cases such as the HAProxy Proxy Protocol, which involves sending protocol-specific data bytes on the connection before the TLS handshake occurs.
  • Method Details

    • createNoop

      static ConnectionListener createNoop()
      Returns a ConnectionListener which does nothing.
      Returns:
      The no-op listener.
    • createWriteOnConnect

      static ConnectionListener createWriteOnConnect(byte[] bytes)
      Returns a ConnectionListener which writes bytes to the socket once the socket is connected.
      Parameters:
      bytes - The bytes to write.
      Returns:
      The listener which will write the given bytes to the socket.
    • socketConnected

      void socketConnected(ConnectedSocketInfo socketInfo) throws IOException
      Called when the given Socket connection has been established and SocketOptions applied, but before any TLS or HTTP application traffic has been sent.
      Parameters:
      socketInfo - The newly connected socket.
      Throws:
      IOException
    • socketChannelConnected

      void socketChannelConnected(ConnectedSocketChannelInfo socketInfo) throws IOException
      Called when the given SocketChannel connection has been established and SocketOptions applied, but before any TLS or HTTP application traffic has been sent.
      Parameters:
      socketInfo - The newly connected socket channel.
      Throws:
      IOException