daurnimator / lua-http

HTTP Library for Lua. Supports HTTP(S) 1.0, 1.1 and 2.0; client and server.
https://daurnimator.github.io/lua-http/
MIT License
795 stars 81 forks source link

it is passible to handle keep-alive connections by the library? #165

Closed andrejlevkovitch closed 3 years ago

andrejlevkovitch commented 4 years ago

http.request create new connection every call go method and close stream. So there is a way to reuse connection several times by keep-alive?

daurnimator commented 4 years ago

The library supports it for the lower level connection and stream apis, but not for the high level request object. The hard bit is knowing if an existing connection is suitable for a new request (need to check dns, certificates, any SSL settings, http version selection, etc. its quite a long list)

See https://github.com/daurnimator/lua-http/pull/121