Expand description
§HorrorHTTP
Please consider not using this library. It is not meant for general use in e.g. a website, but it is very very flexible
HorrorHTTP is an extremely light HTTP library meant to allow for complete flexibility in what you want to do with the connection.
To start, feed a TcpStream and handler state into handle. This creates
a state machine which allows for each state to transition into any other state.
Structs§
- Begin
State - Reads the head, and potentially part of the body. Hands control to
ParseHeadState. - Body
Reader DoNothing - Hands control further along.
- Body
ReaderEOF - Reads the body until EOF (single-side shutdown).
- Body
Reader Header - Reads the body based on Content-Length header.
- Connection
- OrState
- Parse
Head State - Parses the head and hands control to the body_reader.
- Response
Writer - State that writes a response to the socket and then returns control to the custom_handler_state.
- Stop
Processing State
Traits§
Functions§
- handle
- Begins handling a TCP connection. You must choose
a body reader and a handler. The body reader can
be any of
BodyReaderDoNothing, which does not read the body any further than the head reader has already read,BodyReaderHeader, which reads as many bytes as specified by Content-Length, orBodyReaderEOF, which reads until the input closes. Custom BodyReaders may also be used. - handle_
here - Same as
handle, but does not create a thread