BOZOHTTPD(3lua)

NAME
bozohttpd - provides access to libbozohttpd(3) functionality from Lua

SYNOPSIS
local bozo = require 'bozohttpd'

instance = bozo.new()
bozo.init_httpd(instance)
prefs = bozo.init_prefs()
bozo.set_pref(instance, prefs, name, value)
bozo.get_pref(prefs, name)
bozo.setup(instance, prefs, host, root)
bozo.dynamic_mime(instance, one, two, three, four)
bozo.ssl_set_opts(instance, one, two)
bozo.cgi_setbin(instance, bin)
bozo.cgi_map(instance, 1, 2)
req = bozo.read_request(instance)
bozo.process_request(req)
bozo.clean_request(req)

DESCRIPTION
The bozohttpd Lua binding provides access to functionality available in libbozohttpd(3).

EXAMPLES
The following example code demonstrates the process of instantiating an instance of bozohttpd as a background daemon. The instance is set to serve files from /var/www for the hostname www.example.com on TCP port 8080.

    local bozo = require 'bozohttpd'
    myhttpd = bozo.new()
    bozo.init_httpd(myhttpd)
    prefs = bozo.init_prefs()
    bozo.set_pref(myhttpd, prefs, "port number", "8080")
    bozo.set_pref(myhttpd, prefs, "background", 1)
    bozo.setup(myhttpd, prefs, "www.example.com", "/var/www")
    req = bozo.read_request(myhttpd)
    bozo.process_request(req)
    bozo.clean_request(req)

SEE ALSO
lua(1), luac(1), libbozohttpd(3), intro(3lua)

HISTORY
bozohttpd Lua binding first appeared in NetBSD 9.0.

AUTHORS
-nosplit The bozohttpd Lua binding was written by Alistair Crooks <agc@NetBSD.org>.

BUGS
This manual needs more description of the available functionality.