Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A fast HTTP server for the D language
D
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
HttpParser.d
HttpParser.rl
HttpParserCommon.rl
HttpServer.d
IHttpParserVisitor.d
Makefile
README.md
main.d

README.md

dhttpd

A fast HTTP server for the D language

Design

Parsing the HTTP request is very fast by using a Ragel 1 state machine inherited from the Mongrel Ruby webserver but extended a bit to save more memory.

Parsing stores positions into the buffer currently being parsed. If parsing needs more input it returns to the caller. Then the caller has to read more data and append it at the end of the buffer (or construct a new buffer containing all the content), so that all currently stored positions into the buffer stay valid. Then continue parsing with the bigger buffer at the last position.

We do not copy data, nor modify the buffer itself. Custom HTTP headers can be allowed, or disabled. If they are disabled, custom HTTP headers are just ignored. If they are enabled, they will be stored in an array.

Something went wrong with that request. Please try again.