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.2.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.2.0
File Size Uploaded Provenance Actions
serp_http_server-0.2.0.tar.gz 5.8 kB With provenance Details for serp_http_server-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.8 kB

Release files / serp_http_server-0.2.0.tar.gz

Download URL serp_http_server-0.2.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
27c8fc044ddd1886b962eda34df9bec716785c43444a145aa23935e933056ddc
BLAKE2b-256 checksum
How to use checksums
b0609f67be8a19bc525e4514804cf01e1437aace147890c42ce3cd261212904f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

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

Download URL serp_http_server-0.2.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d816d8b672178df2d4d1950dc0bda5139aed83661ec24057e180664ff4b5f9f8
BLAKE2b-256 checksum
How to use checksums
3582978946a556101b70361536624b8eff70cd57ae27dec34dd0ee5ad272ff20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Security for serp-http-server 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for serp_http_server-0.2.0.tar.gz

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 Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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