HTTPD

Contents

Overview

The httpd module provides a class that implements an HTTP server.

local HTTPD = require "httpd"

Functions

HTTPD.new(addr)

Create a new instance of an HTTP server.

HTTPD.start(handler)

Begin serving incoming connections. This function creates a thread for accepting connections and returns immediately to the caller.

The server will create a thread for each incoming connection. These connection threads handle one or more transaction sequentially. Handler functions are called on connection threads.

HTTPD.stop()

Terminate the accepting thread and all connection threads.