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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssserve-0.4.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ssserve-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (63.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

ssserve-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (63.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

ssserve-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (62.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ssserve-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (62.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file ssserve-0.4.0.tar.gz.

File metadata

  • Download URL: ssserve-0.4.0.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ssserve-0.4.0.tar.gz
Algorithm Hash digest
SHA256 d28f583d95be3a71ade43bca1a3d26f219623aa1b118288db688d167b4bf0ceb
MD5 8638888707b6cc7ac024d4b566662251
BLAKE2b-256 2b71fdbf7518de2f37cd01c0e3f2f099742ca510733d14422d0e54f3ac840c2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssserve-0.4.0.tar.gz:

Publisher: publish.yml on prakashsellathurai/ssserve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssserve-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ssserve-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1b7a3b829dc6f23a352676b4e56eb8c369fa2b15b6df8f3aa9ff987363428a4a
MD5 302a9c13c05ea8844d22484520173f07
BLAKE2b-256 a4e472a16eed19cc9cd4e27c0e1ccba21fcf84e705326dc06646b3972cd490e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssserve-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on prakashsellathurai/ssserve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssserve-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ssserve-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d5b34f46207fc0db2b1b858b29f4d6c3ef99f2bf6be6c48b4012d85b09d552c
MD5 08568432fdd4d77b001607a67c98d67f
BLAKE2b-256 a44101c773be66fa965bc863c01a86d66ca963b375f77c654b01746a6d447ff0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssserve-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on prakashsellathurai/ssserve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssserve-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ssserve-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7d7e6a97cd463c0c0cc4546a1cad83fa44a8caf608bde86f7eb3bf4dc9c9ee19
MD5 fd2c699b8a96ec6db4319c3a835630bf
BLAKE2b-256 da17f4b750bea3f51e502bd30988673f0d2adfc1417c36a10fa574601128756e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssserve-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on prakashsellathurai/ssserve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssserve-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ssserve-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2de5dd9c2665613b1f56a64989a3c1ca19883fb2ca23a90638be5c56ea90b6e7
MD5 3a5cdb2c4130e3a7bde17cacb00854bd
BLAKE2b-256 47e68fa767ed82740f5424439e08dd047b6b9aedfc62cda628d66765f9d8a842

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssserve-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on prakashsellathurai/ssserve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

5 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 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