Skip to main content

ssserve

(spelled hisss serve)

Python port of vercel/serve — static file serving and directory listing. (vibecoded)

Run

run directly without installing:

uvx ssserve

Install

uv tool install ssserve

Usage

ssserve [path] [options]

Defaults to current directory and port 3000.

Options

Flag Description
-l, --listen URI Listen endpoint (default: tcp://0.0.0.0:3000, multi-allowed)
-s, --single SPA mode — rewrite 404s to index.html
-C, --cors Enable CORS headers
-u, --no-compression Disable gzip compression
-S, --symlinks Resolve symlinks
-L, --no-request-logging Disable request logging
-c, --config PATH Path to serve.json
--no-etag Disable ETag (use Last-Modified)
--ssl-cert FILE SSL certificate (PEM)
--ssl-key FILE SSL private key (PEM)
--ssl-pass FILE SSL passphrase file
--no-port-switching Don't auto-switch if port is taken
-r, --live-reload Live reload browser on file changes
-d, --debug Debug output
--version Show version
--help Show help

Examples

# Serve current directory on port 3000
ssserve

# Serve specific directory on port 5000 with CORS
ssserve -l 5000 -C ./my-site

# Serve with live reload for development
ssserve -r .

# Serve with live reload on custom port
ssserve -l 5000 -r ./my-site

# Serve with HTTPS
ssserve --ssl-cert cert.pem --ssl-key key.pem

# SPA mode for React/Vue apps
ssserve -s dist

# Multiple listeners
ssserve -l tcp://0.0.0.0:3000 -l unix:/tmp/serve.sock

Configuration

Create a serve.json file in the served directory:

{
  "public": "_site",
  "cleanUrls": true,
  "rewrites": [
    { "source": "/api/**", "destination": "/index.html" }
  ],
  "redirects": [
    { "source": "/old", "destination": "/new", "type": 302 }
  ],
  "headers": [
    {
      "source": "**/*.@(jpg|png)",
      "headers": [
        { "key": "Cache-Control", "value": "max-age=7200" }
      ]
    }
  ],
  "directoryListing": false,
  "trailingSlash": true,
  "etag": true,
  "symlinks": false,
  "renderSingle": false
}

Testing

E2E tests verify behaviour, performance, and resource consumption against a live server process.

# Run all tests
uv run pytest tests/ -v

# Run only e2e tests
uv run pytest tests/e2e/ -v

Test layout

File Tests What it covers
tests/e2e/test_behavior.py 47 File serving, directory listing, clean URLs, redirects, rewrites, CORS, gzip, ETag/304, Range requests, SPA mode, custom headers, symlinks, path traversal
tests/e2e/test_livereload.py 8 Script injection, /__ssserve/lr-check endpoint, file change detection, version tracking
tests/e2e/test_performance.py 8 Latency (p50/p95/p99), TTFB, gzip vs raw, concurrent throughput — measure-only
tests/e2e/test_resources.py 7 RSS memory, CPU usage, file descriptor count — measure-only

Dependencies: pytest, psutil (see [dependency-groups] in pyproject.toml).

Tests run automatically on CI via .github/workflows/tests.yml.

Benchmarks

Micro-benchmarks using airspeed velocity track performance of core operations across commits:

sserve benchmark

Benchmark What it measures
TimeRouteToRegex Pattern compilation for route matching
TimeMatchGlob Glob matching and exclusion lists
TimeParseByteRange HTTP Range header parsing
TimeFormatSize File size formatting
TimeFormatDate Date formatting
TimeParseListen Listen URI parsing
TimeMergeConfig Config merging from serve.json
TimeRenderListing HTML directory listing rendering (100 files)
# Validate benchmarks
uv run asv check --python=same

# Quick run
uv run asv run --python=same --quick

# Full run across configured pythons
uv run asv run

Benchmarks run automatically on CI via .github/workflows/benchmarks.yml.

License

MIT

Metadata

Release files for ssserve 0.4.1

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

Source distribution (sdist)

Source distribution for ssserve 0.4.1
File Size Uploaded Provenance Actions
ssserve-0.4.1.tar.gz 36.6 kB With provenance Details for ssserve-0.4.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ssserve 0.4.1
File Actions
ssserve-0.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for ssserve-0.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
ssserve-0.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for ssserve-0.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
ssserve-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for ssserve-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
ssserve-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for ssserve-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Total release size: 291.7 kB

Release files / ssserve-0.4.1.tar.gz

Download URL ssserve-0.4.1.tar.gz
Size 36.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bf408adafeda3d737b05a0654b0525683cd3f7407a438ff47acb99acda83637d
BLAKE2b-256 checksum
How to use checksums
8c43f00ee92a162c57a3f97801f8c426bbc5d44cd4e73d4be7e1561b2265fec1
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 22, 2026.

Transparency log

Release files / ssserve-0.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ssserve-0.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 64.0 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cf95f15278ad521d774e5d7c6384db0d7c10ae94fc4e49127287b2543e8f5ffd
BLAKE2b-256 checksum
How to use checksums
127535e049e5c34f730590781ce524f8d2b0499f17472f3760feacf93cef725f
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 22, 2026.

Transparency log

Release files / ssserve-0.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ssserve-0.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 64.1 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
284f90e4d4f8f9a6347765b77b9c4504e5185f28dbab9a5a0cca69c2486eb0df
BLAKE2b-256 checksum
How to use checksums
f86147a8281f50dec8ffead94f8bc47482d21e0a7529a43d0e336952dc727e67
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 22, 2026.

Transparency log

Release files / ssserve-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ssserve-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 63.6 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b881fd02c13a9ce50a348c17f21bff72ee4173451d9ce5aad3eb8351ba92e048
BLAKE2b-256 checksum
How to use checksums
a4ff52bc1cf56fcd8f7f25e21b4bf7b63ec31b18642bbe29e73f7b3f79f48457
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 22, 2026.

Transparency log

Release files / ssserve-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ssserve-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 63.5 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
5a79b7faf8239fac46fa8f03d91f088d4224e671a4e096e92c48e5fd3ca7726f
BLAKE2b-256 checksum
How to use checksums
2ad6b4154993db0b35956b9413b394302422ff6d9a1f9678a1f3dc9c0ace8bc5
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 22, 2026.

Transparency log

Security for ssserve 0.4.1

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

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for ssserve-0.4.1.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 Sep 22, 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.

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