This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

Socket Multithreaded Dumb HTTP Server


The sockets/dumb_http_server_mt sample application for Zephyr implements a skeleton HTTP server using a BSD Sockets compatible API. This sample has similar functionality as Socket Dumb HTTP Server except it has support for multiple simultaneous connections, TLS and IPv6. Also this sample application has no compatibility with POSIX. This HTTP server example is very minimal and does not really parse an incoming HTTP request, just reads and discards it, and always serves a single static page.

The source code for this sample application can be found at: samples/net/sockets/dumb_http_server_mt.


Building and Running

Build the Zephyr version of the sockets/dumb_http_server_mt application like this:

west build -b <board_to_use> samples/net/sockets/dumb_http_server_mt

After the sample starts, it expects connections at or 2001:db8::1, port 8080. The easiest way to connect is by opening a following URL in a web browser: or http://[2001:db8::1]:8080/ You should see a page with a sample content about Zephyr (captured at a particular time from Zephyr’s web site, note that it may differ from the content on the live Zephyr site). Alternatively, a tool like curl can be used:

$ curl

Finally, you can run an HTTP profiling/load tool like Apache Bench (ab) against the server:

$ ab -n10

-n parameter specifies the number of HTTP requests to issue against a server.