Skip to content

daurnimator/lua-http

Folders and files

NameName
Last commit message
Last commit date
Jan 27, 2021
Feb 5, 2021
Mar 13, 2017
Sep 8, 2024
Sep 8, 2024
Mar 29, 2016
Dec 16, 2016
Mar 13, 2017
Feb 17, 2016
Aug 26, 2018
Jan 26, 2021
Feb 5, 2021
Feb 5, 2021
Aug 12, 2018

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
  • Cookie Management
  • Websockets
  • Compatible with Lua 5.1, 5.2, 5.3, 5.4 and LuaJIT

Documentation

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

Status

Build Status Coverage Status CII Best Practices

Installation

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

$ luarocks install http

Dependencies

To use gzip compression you need one of:

To check cookies against a public suffix list:

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. See the doc/ directory for more information.