Does OkHttp support HTTP/2 server push?

两盒软妹~` 提交于 2019-12-24 08:34:29

问题


I am developing an Android video streaming application using the OkHttp library and HTTP/2. I am investigating the possibility of using the server push functionality of the HTTP/2 protocol, but I am not sure whether OkHttp supports it or not.

I have a basic server implementation to test HTTP/2 push, which works without problems on the chrome browser (i.e., pushed content is stored in the cache and retrieved from the cache by the browser). When I use the Android application with the OkHttp library, content is not pushed anymore to the client's cache (which is initialized and working properly, by the way). Particularly, the client sends a reset stream to the server for each content the server would like to push.

Do you have any idea if OkHttp supports push streams? And in case it does support server push, are there any best practices to make it work? Thanks in advance for your answers.


回答1:


Nothing currently. We’re rewriting the cache persistence and that’s a big effort. If you want to read the internals there’s callbacks for it, but they currently just cancel the pushed streams.



来源:https://stackoverflow.com/questions/40187251/does-okhttp-support-http-2-server-push

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!