This guide explains the HTTP server examples under ./examples/net/http_* and the supporting standard library modules under ./lib/net/.

It covers what each example does, how to run it, and how the request handling/CGI pieces are implemented.

Prerequisites

Supporting stdlib modules (lib/net)

See documentation/stdlib.md → net/ for a quick index of these modules.

Example: http_static_server.fun

Example: http_server.fun (static + simple .fun CGI)

Example: http_server_cgi.fun (CGI via external interpreter)

Example: http_server_cgi_lib.fun (CGI via stdlib wrapper)

Example: http_mt_server.fun (thread-per-connection)

Example: http_mt_server_cgi.fun (thread-per-connection + CGI)

Example: http_server_test.fun

Common behaviors and notes

How to point htdocs somewhere else

Troubleshooting