Skip to content

leafo/lua-http

 
 

Repository files navigation

HTTP library for Lua.

Features

  • Optionally asynchronous (including DNS lookups and TLS)
  • Supports HTTP(S) version 1.0, 1.1 and 2
  • Functionality for both client and server
  • Websockets
  • Compatible with Lua 5.1, 5.2, 5.3 and LuaJIT

Documentation

Can be found at https://daurnimator.github.io/lua-http/

Status

Build Status Coverage Status

  • First release impending!
  • HTTP request API is mostly stable
  • The HTTP server API is reaching stability

Installation

It's recommended to install lua-http by using luarocks. This will automatically install run-time lua dependencies for you.

$ luarocks install --server=http://luarocks.org/dev http

Dependencies

To use gzip compression you need one of:

If using lua < 5.3 you will need

If using lua 5.1 you will need

For running tests

Development

Getting started

  • 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
    

Generating documentation

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
    

About

HTTP Library for Lua. Supports HTTP(S) 1.0, 1.1 and 2.0; client and server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%