Skip to main content

serp-http-server

A minimal, blocking HTTP/1.1 server for Serpentine. Pure Serpentine ([P]) over serp-socket — the same source dual-runs under CPython. Single-threaded, connection-close model: one request per connection, handled inline in your accept loop (the threaded model waits for Wave-6 concurrency, docs/decisions.md D9).

from serp_http_server import (http_listen, http_accept, http_respond,
                              header_of, HttpRequest)

lst: int = http_listen("127.0.0.1", 8080)
while True:
    req: HttpRequest = http_accept(lst)
    if req.ok and req.path == "/hello":
        http_respond(req, 200, "text/plain", b"hi there")
    else:
        http_respond(req, 404, "text/plain", b"not found")

API

  • http_listen(host, port) -> int (port 0 = pick free), http_port(listener) -> int
  • http_accept(listener) -> HttpRequest — blocks; parses request line, headers (lowercased names), query string and a Content-Length body (10s socket timeout)
  • HttpRequest — conn, ok, method, target, path, query, headers: list[str], body: bytes; ok == False means the request was malformed (answer with 400)
  • header_of(req, name) -> str — case-insensitive header lookup ("" if absent)
  • http_respond(req, status, content_type, body) — writes the response with content-length + connection: close, then closes the connection
  • status_text(code) -> str

Limits

No TLS, no keep-alive, no chunked request bodies, no concurrent connections. Deterministic output (no Date/Server headers).

Metadata

Release files for serp-http-server 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serp-http-server 0.1.0
File Size Uploaded
serp_http_server-0.1.0.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for serp-http-server 0.1.0
File Interpreter ABI Platform
serp_http_server-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / serp_http_server-0.1.0.tar.gz

Download URL serp_http_server-0.1.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
65e604fbea5137d637a4903d9cf39dd5006388790c1fd4d1ae2f0cb288ae7cdc
BLAKE2b-256 checksum
How to use checksums
ebc3f191c44d5db879d4b43ddcf5c8ec4c308699bf22beb1958b405ec1ebce6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / serp_http_server-0.1.0-py3-none-any.whl

Download URL serp_http_server-0.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4b2d8fa65b67a3ad4b776ae1d4b003af021c9da5988bfa84b9cfbb39644354e
BLAKE2b-256 checksum
How to use checksums
8f9d08f98f67f0ef79b85ab65b0a33317839e7bf00ad5cf6b703078d86b80cc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page