Interface ConnectionObserver.ProxyConnectObserver

All Known Implementing Classes:
NoopTransportObserver.NoopProxyConnectObserver
Enclosing interface:
ConnectionObserver

public static interface ConnectionObserver.ProxyConnectObserver
An observer interface that provides visibility into proxy connect events for establishing a tunnel.

Either proxyConnectComplete(Object) or proxyConnectFailed(Throwable) will be invoked to signal successful or failed connection via a proxy tunnel.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Callback when the proxy connect attempt completes successfully.
    default void
    Callback when the proxy connect attempt fails.
  • Method Details

    • proxyConnectFailed

      default void proxyConnectFailed(Throwable cause)
      Callback when the proxy connect attempt fails.

      Reports a CONNECT-exchange failure (e.g. a non-2xx response from the proxy). This fires only after the CONNECT request has been sent. When the connection runs through a TLS proxy and the proxy TLS handshake itself fails, the CONNECT is never sent and the failure is reported solely via the observer returned by ConnectionObserver.onProxySecurityHandshake(SslConfig).

      Parameters:
      cause - the cause of the proxy connect failure
    • proxyConnectComplete

      default void proxyConnectComplete(Object responseMsg)
      Callback when the proxy connect attempt completes successfully.
      Parameters:
      responseMsg - an object that represents a response message. The actual message type depends upon the proxy protocol implementation (e.g. HTTP Tunnel, SOCKS, etc.)