Class ProxyConnection<I extends HttpObject>

Type Parameters:
I - the type of "initial" message. This will be either HttpResponse or HttpRequest.
All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
Direct Known Subclasses:
ClientToProxyConnection, ProxyToServerConnection

abstract class ProxyConnection<I extends HttpObject> extends SimpleChannelInboundHandler<Object>

Base class for objects that represent a connection to/from our proxy.

A ProxyConnection models a bidirectional message flow on top of a Netty Channel.

The read(Object) method is called whenever a new message arrives on the underlying socket.

The write(Object) method can be called by anyone wanting to write data out of the connection.

ProxyConnection has a lifecycle and its current state within that lifecycle is recorded as a ConnectionState. The allowed states and transitions vary a little depending on the concrete implementation of ProxyConnection. However, all ProxyConnections share the following lifecycle events:

By default, incoming data on the underlying channel is automatically read and passed to the read(Object) method. Reading can be stopped and resumed using stopReading() and resumeReading().