This is a multi-threaded HTTP server that I wrote for the following reasons:
- To deep-dive on HTTP
- To learn Rust to have a modern systems-programming language in my toolbelt
It is not intended for production use
- HTTP versions supported:
- HTTP 0.9
- HTTP 1.0
- HTTP 1.1
- Multi-threading: a thread pool is used
- I chose to write my own synchronised queue to push myself with the borrow checker and expose myself to Rust's synchronisation primitives
- This is less efficient than using a MPSC channel like most sources recommend
- Support for arbitary route handlers via the
Handlertrait
- Middleware support: should be a small change to
RequestQueueasHandleralready supports it - IDN support: currently I am assuming that hostnames are in ASCII
- HTTP 2 support
- TLS support
- HTTP 3 support: the interfaces have been written with this in mind (HTTP 3 uses QUIC instead of TCP as the transport protocol)
- Concurrency improvements: move request parsing from the main thread to the worker threads and use non-blocking TCP sockets