Class LoopbackHttp2StreamIdRemapper
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
x-http2-stream-id), a stream that finished after a later one would be opened below the last loopback
id, which is a connection error that closes the whole tunnel.
Each pair is forgotten when its loopback stream is removed, so a long-lived tunnel holds one entry per open stream.
A loopback response with no pair (only a server push could have one) is dropped, as is one whose client stream has
ended. A response relayed as it is streamed arrives in parts (StreamedHttp2ResponsePart), each mapped alike.
Flow control and PRIORITY frames are not relayed between the legs, and a GOAWAY is not translated:
LoopbackHttp2ConnectionCloseHandler sends the client one of its own, from the client connection's ids. A
priority dependency on a request is translated, or dropped when it names no open stream. Sits after the loopback's
Http2ConnectionHandler; one per loopback. It reads and marks the proxy client connection's streams
directly, which is safe only because the loopback is
bootstrapped on the proxy client's event loop (RelayConnectHandler.channelRead0), so both channels, both
connections and this handler are confined to that one thread.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
ConstructorsConstructorDescriptionLoopbackHttp2StreamIdRemapper(org.mockserver.logging.MockServerLogger mockServerLogger, io.netty.handler.codec.http2.Http2Connection loopbackConnection, io.netty.channel.Channel proxyClientChannel) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) voidwrite(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, 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
-
Constructor Details
-
LoopbackHttp2StreamIdRemapper
public LoopbackHttp2StreamIdRemapper(org.mockserver.logging.MockServerLogger mockServerLogger, io.netty.handler.codec.http2.Http2Connection loopbackConnection, io.netty.channel.Channel proxyClientChannel)
-
-
Method Details
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) - Specified by:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.netty.channel.ChannelDuplexHandler
-
channelRead
- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-