Comments (12)
也有这样的需求。match请求参数和请求体里面的判断放在一起,来改响应
from proxyee.
你是问这个项目的还是netty的http模块啊,这个项目的话可以直接通过HttpProxyInterceptPipeline
访问到request和response
from proxyee.
pipeline再获取request的时候,是HttpRequest,不是FullHttpRequest;只能获取到Http请求头,不能获取到请求体,需要根据请求头和请求体进行match,来改响应
from proxyee.
这个目前没有,需要的话可以参考下FullResponseIntercept
,或者在Intercept手动存下每一次的HttpContent直到读取到LastHttpContent再去解析
from proxyee.
请求我加了aggregator编码,直接解析FullHttpRequest,正在改,后面不懂得再向你咨询,多谢!
from proxyee.
HttpProxyServerHandle->handleProxyData(Channel channel, Object msg, boolean isHttp)
确认了msg是FullHttpRequest对象(能够打印出来http请求头和请求体)
HttpProxyClientHandle->channelRead(ChannelHandlerContext ctx, Object msg)
{...
HttpProxyInterceptPipeline interceptPipeline = ((HttpProxyServerHandle) clientChannel.pipeline().get("serverHandle")).getInterceptPipeline();
FullHttpRequest fullHttpRequest = (FullHttpRequest)interceptPipeline.getHttpRequest();
//上面这行代码,我调试使用,fullHttpRequest的只能拿到请求头,不能拿到请求体
//不知道为什么,能帮助解读下吗?
...
}
from proxyee.
作者可否实现 “根据请求头和请求体进行match,来改响应” 的功能?
from proxyee.
嗯 我看看能不能提供一个FullRequestIntercept
from proxyee.
Thanks!
from proxyee.
现在暂时绕了一下,从beforereqest里截取了请求体,然后把请求体中要过滤的内容放到请求头中,然后在match中进行请求头的判断。
期望后期FullRequestIntercept部分的check in,多谢大神!
from proxyee.
@xidianzxm 已经提交了3240814
from proxyee.
可以配合FullRequestIntercept+FullResponseIntercept一起使用
from proxyee.
Related Issues (20)
- 您好,我想问下 我把这工程集成到springboot中,代理就不能正常工作了 HOT 3
- 抓不了JD的包
- 是否提供健康检查的方法? HOT 2
- TCP 链接数量一致在增加 HOT 6
- 请问开启了https代理后,某些网址,如gihtub.com不希望被代理如何设置 HOT 7
- 在阿里云申请了一个免费能信任的证书,替换了ca.crt和der,请问这个时候中间人做代理的时候,理论上会被信任吗 HOT 3
- 连接建立一段时间后,会稳定出现HTTP2超时异常 HOT 3
- Can I specify multiple outgoing ip addresses when I have multiple ethernet cards? HOT 1
- 证书错误,io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Read error: HOT 11
- How to send all the request generating from my application to the proxy HOT 1
- 请问开启了中间人代理后,代理流式(会持续返回)接口,如何实现也流式(response输出)返回,而不是等到最后响应结束后才一次过返回一堆结果(如json) HOT 8
- 大佬,支付宝APP抓不了包,报未知证书错误,但是其他APP可以,这是为啥呀 || Big Brother, the Alipay APP cannot capture the package, and reports an unknown certificate error, but other APPs can, why is this? HOT 1
- 多个拦截器 若某个拦截器的match方法若匹配一次 后续不匹配还会执行此拦截器的handleResponse方法 || Multiple interceptors If the match method of an interceptor matches once, the handleResponse method of this interceptor will be executed if there is no subsequent match
- java.lang.NullPointerException HOT 2
- proxyee设置支持ssl,运行时会出现 Received fatal alert: bad_certificate HOT 1
- 127.0.0.1:9999: invalid IPv6 address
- 支持一下socks5 || Support socks5 HOT 2
- ByteBuf.release() was not called before it's garbage-collected HOT 1
- Hi team, request help for accessing proxyee. HOT 5
- 是否有支持tcp的计划 || Is there any plan to support tcp?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxyee.