Skip to content

seankerr/rust-http-box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Fast push/callback oriented HTTP parser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages