Creates a server configured to listen to multiple URLs.
Creates a server object configured to listen on a single host and port.
The stop function sets a flag that request handlers can (and should) check periodically. If a handler doesn't respond to this flag, the library will force the issue. This determines when and how the issue will be forced.
Reads the command line arguments into the values here.
Starts serving requests according to the current configuration.
Runs the embedded HTTP thread server specifically, regardless of which build configuration you have.
Serves a single HTTP request on this thread, with an embedded server, then stops. Designed for cases like embedded oauth responders
Runs the embedded SCGI server specifically, regardless of which build configuration you have.
Serves a single "connection", but the connection is spoken on stdin and stdout instead of on a socket.
Stops serving after the current requests are completed.
The array of addresses you want to listen on. The format looks like a url but has a few differences.
Sets the host and port the server will listen on. This is semi-deprecated; the new (as of July 31, 2023) listenSpec parameter obsoletes these. You cannot use both together; the listeningHost and listeningPort are ONLY used if listenSpec is null.
Determines the number of worker threads to spawn per process, for server modes that use worker threads. 0 will use a default based on the number of cpus modified by the server mode.
group (gid) to drop privileges to 0 … do nothing
user (uid) to drop privileges to 0 … do nothing
Uses a fork() call, if available, to provide additional crash resiliency and possibly improved performance. On the other hand, if you fork, you must not assume any memory is shared between requests (you shouldn't be anyway though! But if you have to, you probably want to set this to false and use an explicit threaded server with serveEmbeddedHttp) and stop may not work as well.
A server control and configuration struct, as a potential alternative to calling GenericMain or cgiMainImpl. See the source of cgiMainImpl for a complete, up-to-date, example of how it is used internally.
As of version 11 (released August 2023), you can also make things like this: