# joyent/http-parser

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/joyent-http-parser).**

6,445 stars · 1,522 forks · C · MIT · archived

## Links

- GitHub: https://github.com/joyent/http-parser
- awesome-repositories: https://awesome-repositories.com/repository/joyent-http-parser.md

## Description

http-parser is a C library designed for zero-copy HTTP message parsing, URL deconstruction, and the management of protocol upgrades and chunked encoding. It provides utilities to extract headers, methods, and status codes from HTTP requests and responses.

The project includes a zero-copy URL parser for deconstructing strings into individual components and a mechanism for detecting protocol switch requests to identify the exact byte offset where non-HTTP data begins. It also features a decoder for handling chunked transfer-encoded data streams.

## Tags

### Web Development

- [Message Parsing](https://awesome-repositories.com/f/web-development/zero-copy-buffers/http-request-zero-copy-passings/message-parsing.md) — Implements a zero-copy approach to extract header fields, status codes, and methods from HTTP requests and responses. ([source](https://github.com/joyent/http-parser#readme))
- [URL Component Deconstructors](https://awesome-repositories.com/f/web-development/url-construction/url-component-deconstructors.md) — Splits complex URL strings into constituent parts such as host, path, and query parameters.
- [URL Data Parsing](https://awesome-repositories.com/f/web-development/url-data-parsing.md) — Converts raw URL strings into structured components using a zero-copy utility. ([source](https://github.com/joyent/http-parser#readme))
- [Protocol Upgrades](https://awesome-repositories.com/f/web-development/protocol-upgrades.md) — Detects requests to switch protocols and identifies the byte offset where the new protocol stream begins.

### Data & Databases

- [Zero-Copy Parsing](https://awesome-repositories.com/f/data-databases/zero-copy-data-access-libraries/zero-copy-deserialization/zero-copy-parsing.md) — Extracts data from input buffers by referencing pointers to the original memory instead of allocating new tokens.

### Networking & Communication

- [Chunked Transfer Encoding](https://awesome-repositories.com/f/networking-communication/chunked-transfer-encoding.md) — Decodes data streams using chunked transfer encoding to retrieve the final response body.
- [HTTP Message Parsers](https://awesome-repositories.com/f/networking-communication/http-message-parsers.md) — Provides a C library for extracting headers, methods, and status codes using a high-performance zero-copy approach.
- [URL Parsers](https://awesome-repositories.com/f/networking-communication/url-parsers.md) — Offers a high-performance utility for deconstructing URL strings into individual components without memory allocation.
- [HTTP Upgrade Handlers](https://awesome-repositories.com/f/networking-communication/http-upgrade-handlers.md) — Handles the conversion of inbound HTTP requests into persistent connections by detecting protocol upgrade requests.
- [Stream Offset Tracking](https://awesome-repositories.com/f/networking-communication/message-stream-handlers/message-stream-consumer-groups/stream-offset-tracking.md) — Tracks the exact byte position within the message stream to identify where protocol transitions occur.

### Programming Languages & Runtimes

- [Incremental Stream Processing](https://awesome-repositories.com/f/programming-languages-runtimes/data-compression-and-decompression/incremental-stream-processing.md) — Processes incoming HTTP data incrementally in small chunks to avoid loading entire requests into memory.
- [State-Based Parsing](https://awesome-repositories.com/f/programming-languages-runtimes/state-based-parsing.md) — Uses a state-machine based parsing technique to track context and handle byte streams incrementally.

### Operating Systems & Systems Programming

- [C Memory Management](https://awesome-repositories.com/f/operating-systems-systems-programming/c-memory-management.md) — Implements low-level memory allocation and cleanup for buffers within a C-based library to minimize overhead.

### Part of an Awesome List

- [Development Utilities](https://awesome-repositories.com/f/awesome-lists/devtools/development-utilities.md) — C-based HTTP request/response parser.
