A Lua HTTP client cosocket driver for OpenResty/ngx_lua, supporting streaming, keepalives, and proxy connections.
lua-resty-http is a Lua library that provides an HTTP client interface for OpenResty and ngx_lua environments. It allows developers to make HTTP requests directly from Nginx using Lua's cosocket API, enabling non-blocking network operations within the Nginx worker process. The library solves the need for efficient, feature-complete HTTP communication from Lua code running in OpenResty.
OpenResty and ngx_lua developers who need to make HTTP requests from within Nginx configurations, particularly those building API gateways, reverse proxies, or microservices that require external HTTP communication.
Developers choose lua-resty-http because it's specifically designed for the OpenResty ecosystem, offering production-ready HTTP client capabilities with proper connection pooling, streaming support, and safety features for SSL/proxy configurations that generic Lua HTTP clients lack.
Lua HTTP client cosocket driver for OpenResty / ngx_lua.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Explicitly marked as 'Production ready' with continuous integration tests via GitHub Actions, ensuring stability for critical deployments.
Provides a body_reader iterator for chunked response reading, allowing predictable memory usage with configurable buffer sizes, ideal for large data handling.
Supports keepalives, connection pooling, and request pipelining, leveraging OpenResty's cosocket API for non-blocking performance optimizations.
Includes SSL/TLS with mTLS support (requires ngx_lua_http_module >= v0.10.23) and proxy authentication, enabling secure communications in complex networks.
Only supports HTTP/1.0 and 1.1, lacking HTTP/2 which is essential for modern web performance optimizations like multiplexing and header compression.
Designed exclusively for OpenResty/ngx_lua environments, making it incompatible with other Lua runtimes or applications outside Nginx, reducing portability.
Includes deprecated methods like connect_proxy and ssl_handshake that may be removed, and the dual-mode interface can be confusing, requiring deeper understanding for effective use.