monkeyWie / proxyee

HTTP proxy server,support HTTPS&websocket.MITM impl,intercept and tamper HTTPS traffic.
MIT License
1.54k stars 573 forks source link

java.lang.NullPointerException #285

Open liuhulu opened 1 year ago

liuhulu commented 1 year ago

[beforeCatch,31] - Proxy error:Cannot invoke "com.github.monkeywie.proxyee.intercept.HttpProxyInterceptPipeline.beforeRequest(io.netty.channel.Channel, io.netty.handler.codec.http.HttpContent)" because the return value of "com.github.monkeywie.proxyee.handler.HttpProxyServerHandler.getInterceptPipeline()" is null java.lang.NullPointerException: Cannot invoke "com.github.monkeywie.proxyee.intercept.HttpProxyInterceptPipeline.beforeRequest(io.netty.channel.Channel, io.netty.handler.codec.http.HttpContent)" because the return value of "com.github.monkeywie.proxyee.handler.HttpProxyServerHandler.getInterceptPipeline()" is null at com.github.monkeywie.proxyee.handler.HttpProxyServerHandler.channelRead(HttpProxyServerHandler.java:195) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) 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.base/java.lang.Thread.run(Thread.java:833)

liuhulu commented 1 year ago

本地windows7没有出现过这个问题,jdk17.0.8 服务器CentOS Linux release 7.9.2009 (Core) 上出现了这个问题。jdk17.0.2

proxyee 1.7.6

复现步骤 curl -i -x ip:port -U x:x https://www.baidu.com 第一次可以正常请求

curl -i -x ip:port -U x:x https://www.google.com 第二次 异常 curl: (56) Recv failure: Connection was reset

curl -i -x ip:port -U x:x https://www.google.com 第三次报以上错误 curl: (56) Proxy CONNECT aborted


This problem has not occurred in local windows7, jdk17.0.8 This problem occurs on the server CentOS Linux release 7.9.2009 (Core). jdk17.0.2

proxyee 1.7.6

Reproduction steps curl -i -x ip:port -U x:x https://www.baidu.com The first request can be made normally

curl -i -x ip:port -U x:x https://www.google.com Second time exception curl: (56) Recv failure: Connection was reset

curl -i -x ip:port -U x:x https://www.google.com The above error is reported for the third time curl: (56) Proxy CONNECT aborted

liuhulu commented 1 year ago

补充,局域网内没有问题,使用公网IP代理就有这个问题。


Supplement, there is no problem in the LAN, but there is this problem when using the public IP proxy.