java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
org.mockserver.netty.proxy.relay.LoopbackResetRelay
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public final class LoopbackResetRelay
extends io.netty.channel.ChannelInboundHandlerAdapter
Carries a deliberate reset (an
HttpError resetConnection, or a chaos resetPeer or
resetMidResponse) of a CONNECT/SOCKS tunnel's loopback through to the tunnel's client connection, which the
relay would otherwise end with a clean close (or, on h2, a GOAWAY and stream resets). MockServer's end of the
loopback marks the client connection, then ends the loopback's output rather than resetting it
(ConnectionReset.reset(io.netty.channel.Channel)); this handler, first on the relay's end of the loopback, resets the client
connection as the loopback closes (or a reset of it is read), before the relay's other handlers react to it, and
after what the relay has already written to the client, so a response MockServer wrote first reaches the client
first. A loopback reset nobody asked for is left to the relay's usual handling.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) static voidrelayResetsOf(io.netty.channel.Channel accepted) On MockServer's end of a relay loopback: a reset of it also resets the tunnel's client connection.Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Method Details
-
relayResetsOf
public static void relayResetsOf(io.netty.channel.Channel accepted) On MockServer's end of a relay loopback: a reset of it also resets the tunnel's client connection. -
exceptionCaught
- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter
-