-
-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问开启了中间人代理后,代理流式(会持续返回)接口,如何实现也流式(response输出)返回,而不是等到最后响应结束后才一次过返回一堆结果(如json) #281
Comments
不要使用FullResponseIntercept就行了,因为要完整解码响应的话肯定是得拿到全部的报文才行。 Just don't use FullResponseIntercept, because if you want to fully decode the response, you must get all the packets. |
因为需要拿到请求的报文和响应的报文做内容审查,但是又不对原来的响应速度造成影响,可以一边先流式输出,等到结束才拿到所有报文存起来麽 |
理论上是可以的,但是需要自己实现一个类似FullResponseIntercept的拦截器,不过如果只是做记录的话很简单的,把每次过来的Content缓存住,判断是最后一个Content的时候再解码处理 |
pipeline.addLast(new 类似FullResponseIntercept的拦截器() { 如果是这样下面这段还需要吗 |
实现这个最基础的拦截器
Just implement this method in the most basic interceptor
|
感谢大佬,我试试 Thanks guys, I'll try |
是这个意思嘛
|
嗯,就是这个意思,然后细节方面你再调下应该就行了 Well, that’s what it means, and then you should adjust the details |
{“result”:"1"}
{“result”:"12"}
{“result”:"123"}
The text was updated successfully, but these errors were encountered: