Description
lua-resty-http is a Lua HTTP client for OpenResty and ngx_lua. It uses cosockets, so it runs inside the nginx event loop without blocking. The README marks it as production ready. It supports HTTP 1.0 and 1.1, SSL, mutual TLS (with a minimum ngx_lua_http_module version), chunked and non-chunked transfer, connection keepalives and request pipelining. Responses can be read as a stream, which keeps memory use predictable, and there is a simpler one-shot request interface for cases where you do not need to manage the connection yourself. It also supports HTTP proxy connections, trailers, and W3C trace context propagation through the traceparent header from version 0.18.0. The API includes methods for connecting, setting timeouts and keepalive, sending requests and pipelines, parsing URIs, and reading the body and trailers. Several proxy-related methods are marked as deprecated. The module is distributed through LuaRocks, and the README gives installation instructions.…
Highlights
- HTTP 1.0 and 1.1 client for OpenResty
- SSL and mutual TLS
- Streaming response bodies
- Connection keepalive and pipelining
- W3C traceparent propagation
Ratings & Reviews
No ratings yet
Be the first to rate Lua Resty Http.
People also visit
Lua Resty Http FAQ
What is lua-resty-http?
A Lua HTTP client cosocket driver for OpenResty and ngx_lua, so you can make HTTP requests inside nginx.
Is it production ready?
The README's status section says it is production ready.
How do I install it?
It is distributed through LuaRocks as the pintsized lua-resty-http module, and the README gives the install command.
Does it support mTLS and proxies?
Yes. It supports mutual TLS, which needs a recent ngx_lua_http_module, and HTTP proxy connections.
Which methods are deprecated?
connect_proxy, ssl_handshake, proxy_request and proxy_response are marked as deprecated and may be removed.
What are the best Lua Resty Http alternatives?
Popular alternatives to Lua Resty Http include Confluence, Httpx Static and Nginx Live Win32. See all Lua Resty Http alternatives
