Open freedom1b2830 opened 1 year ago
also how to do it? "enable DEBUG level for full stacktrace"
can you post code?
Unable to reproduce, can you provide the simplest and reproducible code?
https://github.com/freedom1b2830/monkeyWieBug maven java8+
@freedom1b2830 Pls provide specific reproduction steps, such as:
1. xxx
2. xxx
3. curl -k -x 127.0.0.1:9999 https://www.google.com
1.generated a root certificate 2.added it to the trusted centers in the systems (trust anchor –store /path) 3.configured firefox (http+https proxy) 4.I visited sites where there are resources from blocked domains through iptables (iptables -A OUTPUT -d $blockedIP -j REJECT)
@freedom1b2830 I still can't reproduce the problem, can you test with curl command? My test:
1. add a line of code `domainsBlockRegEx.add("baidu.com")`
2. ping www.badu.com get ip 14.215.177.39
3. sudo iptables -A OUTPUT -d 14.215.177.39 -j REJECT
4. start server
5. curl -k -x 127.0.0.1:9999 https://www.baidu.com
and it no exception.
the application was suspended at the time of the NPE being thrown out
heap dump 1.zip
in code:
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
ctx.channel().close();
clientChannel.close();
HttpProxyExceptionHandle exceptionHandle = ((HttpProxyServerHandler) clientChannel.pipeline()
.get("serverHandle")).getExceptionHandle();
exceptionHandle.afterCatch(clientChannel, ctx.channel(), cause);
}
(HttpProxyServerHandler) clientChannel.pipeline().get("serverHandle")==null
I am getting an exception in this thread
"nioEventLoopGroup-2-4" #38 prio=10 os_prio=0 cpu=397,75ms elapsed=199,42s tid=0x00007f284c083b70 nid=107057 runnable [0x00007f2839df6000]
java.lang.Thread.State: RUNNABLE
at com.github.monkeywie.proxyee.handler.HttpProxyClientHandler.exceptionCaught(HttpProxyClientHandler.java:55)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:302)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:281)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:273)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireExceptionCaught(CombinedChannelDuplexHandler.java:424)
at io.netty.channel.ChannelHandlerAdapter.exceptionCaught(ChannelHandlerAdapter.java:92)
at io.netty.channel.CombinedChannelDuplexHandler$1.fireExceptionCaught(CombinedChannelDuplexHandler.java:145)
at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:143)
at io.netty.channel.CombinedChannelDuplexHandler.exceptionCaught(CombinedChannelDuplexHandler.java:231)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:302)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:281)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:273)
at io.netty.handler.ssl.SslHandler.exceptionCaught(SslHandler.java:1105)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:302)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:281)
at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:273)
at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1377)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:302)
at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:281)
at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:907)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.handleReadException(AbstractNioByteChannel.java:125)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:177)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(java.base@18.0.2/Thread.java:833)
Locked ownable synchronizers:
- None
The situation is this, some ip addresses are blocked by iptables (
iptables -A OUTPUT -d ip -j REJECT
). Because of this, the proxy gives these exceptions:How to assign a handler for these exceptions/silence these exceptions?