HTTPlib Features

Features

The following features are among those supported:

Virtual Hosts

Variables and method handlers are registered per virtual host. If no virtual hosts have been created a default host is created. When handling a request, the virtual host is selected by the request URL or Host: header.

Method Handlers

HTTP requests are handled by callback functions registered by URL path prefix and method name. Multiple handlers may be registered for a method, during a request the most specific path name prefix is used to select the handler.

Variables

Variables, i.e. name value pairs, may be registered and queried via API calls. Variables are typically used by request callbacks, for example to locate the document root. Like method handlers, variables may be multiply defined and the most specific path name prefix is used to select the variable.

Authentication

Callbacks may be registered to handle request authentication.

SSL/TLS

There is basic support for SSL/TLS using the OpenSSL package and SNI is supported. It is more or less identical to the TLS code from libESMTP so it should be very reliable.

Hash Tables

A generic hash table module used by callback registration API calls etc. and which has been useful in applications in its own right. Some aspects of the API could be better, a victim of the ‘seemed like a good idea at the time’ syndrome and a bit of creeping featureism, but everything works well and has proven reliable.

Parsers

A collection of functions to parse URLs and strings, various tokens defined in a number of RFCs and miscellaneous other stuff. These are used within the library but are also useful to applications.