http-box

Crates.iohttp-box
lib.rshttp-box
version0.1.6
sourcesrc
created_at2016-12-06 21:55:45.715346
updated_at2023-08-28 19:41:10.516667
descriptionFast push/callback oriented HTTP parser
homepagehttps://github.com/seankerr/rust-http-box
repositoryhttps://github.com/seankerr/rust-http-box
max_upload_size
id7497
size619,209
Sean Kerr (seankerr)

documentation

https://docs.rs/http-box

README

http-box

Build: Passing dev: 0.1.6 license: Apache 2.0

What is http-box?

http-box is a push oriented HTTP 1 & 2 parser with the goal of remaining fast and bare bones. Utilities are provided for handling additional HTTP details such as query parsing, decoding hex encoded strings, and header field parsing.

The intent of http-box is to parse HTTP content and nothing more, so you will not find Request or Response types within the library. They have not been ruled out entirely, however, if they are provided at any future point, they will be provided by a utility crate.

http-box will happily process any &[u8] data, and is not tied to any socket or network dependencies.

Features

  • New: HTTP/2 support
  • Push oriented and will process a single byte at a time
  • Data is received via callback with the ability to break out of the parser loop at any point
  • HTTP/1.x headers are normalized to lower-case
  • Errors report type of error and on which byte it occurred
  • Parse HTTP/1.x phases separately:
    • Head
      • Request / Response
      • Headers
    • Multipart
      • Headers
      • Data
    • Chunk Transfer-Encoded
      • Chunk Length
      • Extensions
      • Chunk Data
      • Trailers
    • URL encoded
      • Parameters
  • Zero copy philosophy
  • DoS protection is easily supported
  • Fast!
  • Use with any networking library

API Documentation

https://docs.rs/http-box/0.1.6/http_box/

HTTP/2.x Examples

HTTP/1.x Examples

HTTP Utilities

Commit count: 551

cargo fmt