benjaminjamesxyz/esp_http_server

1.0.0

Latest
uploaded 4 days ago
Custom lightweight HTTP server component optimized for embedded ESP32 systems using C++23

readme

# ESP32 HTTP Server Component

A lightweight, efficient HTTP server component for ESP32 using ESP-IDF, written in modern C++23.

## Features

- Minimal and embeddable HTTP server optimized for the ESP32 platform
- Route handling with efficient FNV-1a hash-based lookup
- Fixed-size memory buffers to avoid dynamic allocation
- Connection timeout handling and error recovery
- Fully implemented in idiomatic C++23 with constexpr and string_view
- Designed for easy integration as an ESP-IDF component

## Requirements

- ESP-IDF v4.1.0 or newer
- C++23 compatible toolchain (ESP-IDF sets `-std=gnu++2b`)
- ESP32 target hardware

## Installation

Clone the repository into your ESP-IDF components directory:

```
cd $IDF_PATH/components
git clone https://github.com/benjaminjamesxyz/esp_http_server.git
```

Include `http_server` in your `CMakeLists.txt` components list.

## Usage

### Adding Routes

```
http_server::HttpServer server;

server.add_route("/hello", http_server::HttpMethod::GET, [](netconn *conn, std::string_view req) {
    // Handle GET /hello
    // Build and send HttpResponse here
    return 0;
});

server.start();
```

### Running Server

Call `server.start()` to start the listener task.

## Contributing

Contributions, bug reports, and feature requests are welcome! Please open issues or pull requests.

## License

MIT License - see the [`LICENSE`](LICENSE) file for details.

---

Built with ESP-IDF and modern C++23 for embedded systems enthusiasts.

Links

  • Repository Repository

Supports all targets

License: MIT

To add this component to your project, run:

idf.py add-dependency "benjaminjamesxyz/esp_http_server^1.0.0"

download archive

Stats

  • Archive size
    Archive size ~ 5.67 KB
  • Downloaded in total
    Downloaded in total 0 times
  • Downloaded this version
    This version: 0 times

Badge

benjaminjamesxyz/esp_http_server version: 1.0.0
|