Skip to content
Back to skills

Esp32 Http Server

ASecurity

Use when an ESP32 serves HTTP or WebSocket - a handler never fires, large responses truncate, the server stops answering under load, or an upload kills the connection. Covers esp_http_server configuration and handler design.

  • 16 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
ai-agentsapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add Esmail-sarhadi/esp32-agent-skills --skill esp32-http-server --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Esp32 Http Server?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Esp32 Http Server
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/esmail-sarhadi-esp32-http-server/badge)](https://www.skillsdirectory.com/skills/esmail-sarhadi-esp32-http-server)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: esp32-http-server
description: Use when an ESP32 serves HTTP or WebSocket - a handler never fires, large responses truncate, the server stops answering under load, or an upload kills the connection. Covers esp_http_server configuration and handler design.
license: MIT
---

# HTTP server on ESP32

`esp_http_server` is small, single-threaded per connection and configured by a
handful of `CONFIG_HTTPD_*` values that are easy to leave at defaults and then
blame on the network.

## Registration

One handler per URI, and the match function decides how strictly a URI must
match. Wildcard matching is **off by default**:

```c
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
config.uri_match_fn = httpd_uri_match_wildcard;
```

Without that line, a handler registered for `/api/*` is never called and the
server returns 404 - which looks like a routing bug and is a config line.

## Limits that surface as "the server died"

| Limit | Symptom when exceeded |
|---|---|
| `max_uri_handlers` | the last registered handlers never fire |
| `max_open_sockets` | connections are refused once a browser opens several |
| header length | long cookies or auth headers are rejected |
| `stack_size` of the httpd task | crashes inside a handler that does real work |

## Do not block the handler

A handler runs on the server task. Sleeping, waiting on a queue, or doing a long
flash write inside it stalls every other connection. Copy the request, hand the
work to a queue, and respond from the worker - or accept that the server serves
one client at a time.

## Large responses

Send in chunks and yield. Building a 200 KB string in RAM to `httpd_resp_send()`
it in one call is a heap allocation that will fail on a fragmented heap, and the
failure looks like a truncated page.

## Uploads

`multipart/form-data` means parsing a boundary out of the body. If the client can
send a raw body instead, do that - it removes the parser, the boundary handling
and the size arithmetic in one move.

## WebSocket

`httpd_ws_*` handles the framing, but not the keep-alive. A socket with no traffic
for longer than the client's idle timeout closes with 1006 and no explanation.
Send a ping on a timer.

## Rules for the agent

- Set `uri_match_fn`, `max_uri_handlers` and the task stack explicitly. Defaults
  are tuned for a demo, not a product.
- Never do flash writes inside a handler.
- If a design needs TLS, use `httpd_ssl_start()` and budget the RAM for it - the
  handshake is the largest single allocation in the system.

Files in this skill

  • LICENSE.txt857 B
  • SKILL.md2.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.