- Optionally asynchronous (including DNS lookups and SSL)
- Compatible with Lua 5.1, 5.2, 5.3 and LuaJIT
Can be found at https://daurnimator.github.io/lua-http/
This project is a work in progress and not ready for production use.
- HTTP 1.1
- HTTP 2
- Connection pooling
-
socket.http
compatibility layer - Prosody
net.http
compatibility layer - Handle redirects
- Be able to use an HTTP proxy
- Compression (e.g. gzip)
- Websockets
- cqueues >= 20150907
- luaossl >= 20150727
- basexx >= 0.2.0
- lpeg_patterns >= 0.2
- fifo
If you want to use gzip compression you will need one of:
If using lua < 5.3 you will need
- compat-5.3 >= 0.3
If using lua 5.1 you will need
- luabitop (comes with LuaJIT) or a backported bit32
-
Clone the repo:
$ git clone https://github.com/daurnimator/lua-http.git $ cd lua-http
-
Install dependencies
$ luarocks install --only-deps http-scm-0.rockspec
-
Lint the code (check for common programming errors)
$ luacheck .
-
Run tests and view coverage report (install tools first)
$ busted -c $ luacov && less luacov.report.out
-
Install your local copy:
$ luarocks make http-scm-0.rockspec
Documentation is written in markdown and intended to be consumed by pandoc
-
To generate self-contained HTML documentation:
$ pandoc -t html5 --template=doc/template.html --section-divs --self-contained --toc -c doc/site.css doc/index.md doc/metadata.yaml
-
To generate a pdf manual:
$ pandoc -s -t latex -V documentclass=article -V classoption=oneside -V links-as-notes -V geometry=a4paper,includeheadfoot,margin=2.54cm doc/index.md doc/metadata.yaml -o lua-http.pdf