proxyee icon indicating copy to clipboard operation
proxyee copied to clipboard

拦截请求后自定义请求和响应返回,如何实现?

Open 772451348 opened this issue 4 years ago • 4 comments

772451348 avatar Mar 30 '20 01:03 772451348

参考:https://github.com/monkeyWie/proxyee/blob/master/src/test/java/com/github/monkeywie/proxyee/InterceptFullHttpProxyServer.java

monkeyWie avatar Mar 30 '20 06:03 monkeyWie

这个两个match同时返回true会用不了

hzceo avatar May 26 '20 10:05 hzceo

拦截请求自定义处理有个不方便的地方,就是只能有1对出现,见下方代码, 如果2个Response都要处理的话就会报错

 pipeline.addLast(new FullResponseIntercept() {
      @Override
      public boolean match(HttpRequest httpRequest, HttpResponse httpResponse, HttpProxyInterceptPipeline pipeline) {
                 return true;
     }
      @Override
       public void handelResponse(HttpRequest httpRequest, FullHttpResponse httpResponse, HttpProxyInterceptPipeline pipeline) {
              //TODO
       }
});

luyuanwan avatar Aug 22 '20 07:08 luyuanwan

@luyuanwan 只会有一个Response呀,没懂你的意思。

monkeyWie avatar Aug 23 '20 03:08 monkeyWie