man.bsd.lv manual page server

Manual Page Search Parameters

BOZOHTTPD(3lua) 3lua BOZOHTTPD(3lua)

bozohttpdprovides access to libbozohttpd(3) functionality from Lua

local bozo = require 'bozohttpd'

 
 
 
 
 
 
 
 
 
 
 
 
 

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

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)

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

bozohttpd Lua binding first appeared in NetBSD 9.0.

The bozohttpd Lua binding was written by Alistair Crooks <agc@NetBSD.org>. This manual was written by Sevan Janiyan <sevan@NetBSD.org>.

This manual needs more description of the available functionality.

May 6, 2018 NetBSD-9.2