exchange.putAttachment(THROWABLE, exception);
exchange.dispatch(SameThreadExecutor.INSTANCE, next);
}
public void handleDone(final HttpClientConnection connection, final HttpServerExchange exchange) {
final HttpServerConnection serverConnection = exchange.getConnection();
final SimpleProxyClient simpleProxyClient = new SimpleProxyClient(connection);
//we attach to the connection so it can be re-used
serverConnection.putAttachment(clientAttachmentKey, simpleProxyClient);
exchange.putAttachment(CLIENT, simpleProxyClient);
serverConnection.addCloseListener(new HttpServerConnection.CloseListener() {
@Override
public void closed(HttpServerConnection connection) {
IoUtils.safeClose(serverConnection);
}
});