Package org.mockserver.netty.proxy
Class BinaryRequestProxyingHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.buffer.ByteBuf>
org.mockserver.netty.proxy.BinaryRequestProxyingHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
@Sharable
public class BinaryRequestProxyingHandler
extends io.netty.channel.SimpleChannelInboundHandler<io.netty.buffer.ByteBuf>
- Author:
- jamesdbloom
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
ConstructorsConstructorDescriptionBinaryRequestProxyingHandler(org.mockserver.configuration.Configuration configuration, org.mockserver.logging.MockServerLogger mockServerLogger, org.mockserver.scheduler.Scheduler scheduler, org.mockserver.httpclient.NettyHttpClient httpClient, org.mockserver.mock.HttpState httpState) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) protected voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf byteBuf) voidchannelReadComplete(io.netty.channel.ChannelHandlerContext ctx) voidchannelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx) booleanconnectBeforeClientSpeaks(io.netty.channel.ChannelHandlerContext ctx) Opens the upstream connection of a connection whose client has sent nothing, for a server that speaks first (forwardBinaryServerFirstWaitMillis).voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) voidhandlerRemoved(io.netty.channel.ChannelHandlerContext ctx) voiduserEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object event) A binary client that turns TLS on part way through reaches here once its server certificate is chosen, before anything it sends over TLS is decrypted: the relay then starts TLS with the upstream on the same connection.Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregisteredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, 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
-
Constructor Details
-
BinaryRequestProxyingHandler
public BinaryRequestProxyingHandler(org.mockserver.configuration.Configuration configuration, org.mockserver.logging.MockServerLogger mockServerLogger, org.mockserver.scheduler.Scheduler scheduler, org.mockserver.httpclient.NettyHttpClient httpClient, org.mockserver.mock.HttpState httpState)
-
-
Method Details
-
channelRead0
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf byteBuf) - Specified by:
channelRead0in classio.netty.channel.SimpleChannelInboundHandler<io.netty.buffer.ByteBuf>
-
connectBeforeClientSpeaks
public boolean connectBeforeClientSpeaks(io.netty.channel.ChannelHandlerContext ctx) Opens the upstream connection of a connection whose client has sent nothing, for a server that speaks first (forwardBinaryServerFirstWaitMillis). Must be called on the connection's event loop.- Returns:
- false, having opened nothing, for a connection with no target
-
handlerRemoved
public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
handlerRemovedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerRemovedin classio.netty.channel.ChannelHandlerAdapter
-
channelReadComplete
public void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelReadCompletein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadCompletein 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
-
channelWritabilityChanged
public void channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelWritabilityChangedin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelWritabilityChangedin classio.netty.channel.ChannelInboundHandlerAdapter
-
userEventTriggered
public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object event) throws Exception A binary client that turns TLS on part way through reaches here once its server certificate is chosen, before anything it sends over TLS is decrypted: the relay then starts TLS with the upstream on the same connection.- Specified by:
userEventTriggeredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
userEventTriggeredin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
exceptionCaught
- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-