lua-resty-http2
lua-resty-http2 copied to clipboard
如何复用TCP连接?
HTTP2 针对TCP连接是多路复用的,但是我使用 lua-resty-http2 发起的tcp连接没有办法实现多路复用。
请问文档中描述的 client:keepalive 接口该如何使用?我按照文档的方法测试,发现还是会创建新的tcp连接
我主要是想利用 lua-resty-http2 这个模块实现一个h2代理,达到的效果是,代理与客户端之间运行的http2协议维持的是一个TCP连接,代理与后端服务器之间运行http2协议维持的也是一个TCP连接。
You may try to create a timer, which accepts requests from requests in the same worker, the timer opens one connection to upstream by the HTTP/2 multiplex mechanism, and backs the response to the correct request.
You may try to create a timer, which accepts requests from requests in the same worker, the timer opens one connection to upstream by the HTTP/2 multiplex mechanism, and backs the response to the correct request.
I don't quite understand what you mean,can you give me a demo about how to use h2 multiplex mechanism ,thanks a lot.