A temporary dependency-free static HTTP server with byte-range support.
Project description
static-http
static-http is a tiny dependency-free Python utility that starts a temporary static HTTP server in the current directory with byte-range support for quick local workflows.
It is intentionally focused on temporary file serving for local development, manual testing, media playback, and archive inspection.
Why this exists
python -m http.server is excellent for quick sharing but does not implement byte-range request handling. static-http fills that gap with a small CLI that keeps the behavior predictable and easy to reason about.
Install
uvx static-http
pipx run static-http
python -m pip install static-http
Quick start
static-http
uvx static-http
By default:
- Serves the current working directory.
- Binds to
0.0.0.0. - Listens on port
8080. - Uses a threaded HTTP server.
- Handles
GET,HEAD, and single-range requests.
CLI
static-http supports these options:
-p, --port PORT— listening port.0requests an OS-assigned port.-d, --directory PATH— root directory to serve. Default is the current directory.-b, --bind ADDRESS— bind address. Default is0.0.0.0.--localhost-only— equivalent to--bind 127.0.0.1.--cors— addsAccess-Control-Allow-Origin: *.--header "Name: Value"— repeatable custom headers.--no-dir-list— disable directory listing responses when no index file exists.--open— open the server URL in the default browser after startup.--qr— render a terminal QR code for the server URL.--no-cache— sendCache-Control: no-store.--quiet— suppress per-request logs.--verbose— print detailed startup/binding information.--version— print package version and exit.
Examples
static-http --open
static-http --qr
static-http --no-cache
static-http --quiet
static-http --verbose
static-http --port 9000 --cors
static-http --no-dir-list
Shutdown
Press Q or q in the focused terminal to stop the server. Ctrl+C also triggers a graceful shutdown.
Range support
GET requests support single byte ranges with examples:
curl -H "Range: bytes=0-99" http://localhost:8080/video.mp4 -o part.bin
curl -H "Range: bytes=100-" http://localhost:8080/video.mp4 -o tail.bin
curl -H "Range: bytes=-500" http://localhost:8080/video.mp4 -o suffix.bin
The server returns 206 Partial Content for satisfiable ranges, 416 Range Not Satisfiable when the range is outside the file, and 400 Bad Request for invalid range syntax.
Security note
static-http is intentionally a temporary local development/file-serving tool, not a production web server.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file static_http-0.1.2.tar.gz.
File metadata
- Download URL: static_http-0.1.2.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce8d7e394622edbc27998dd8e3b5d7e3ab18126947beb2c1409025f019c4c886
|
|
| MD5 |
bf4747fa075c255855e493c44df4ca4c
|
|
| BLAKE2b-256 |
32d4ef1f8e958ecd317dd5160e2cb0aa5a13a6ce443b1695c2256d742c46758e
|
Provenance
The following attestation bundles were made for static_http-0.1.2.tar.gz:
Publisher:
release.yml on pseudosavant/static-http
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
static_http-0.1.2.tar.gz -
Subject digest:
ce8d7e394622edbc27998dd8e3b5d7e3ab18126947beb2c1409025f019c4c886 - Sigstore transparency entry: 1828075405
- Sigstore integration time:
-
Permalink:
pseudosavant/static-http@780c8d0512cbd6db50a6b864dce37e76301bee3b -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/pseudosavant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@780c8d0512cbd6db50a6b864dce37e76301bee3b -
Trigger Event:
push
-
Statement type:
File details
Details for the file static_http-0.1.2-py3-none-any.whl.
File metadata
- Download URL: static_http-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcbf17a8307d0e963dfe8b522caeae08c0c14e7458892c220e9eeb2065ec0ed1
|
|
| MD5 |
2b12cfe9d63995008b4140e0215f04da
|
|
| BLAKE2b-256 |
98c039030bd3c41b19a2834b9788abd5f6f8027f0ad81533663b8a67edf11937
|
Provenance
The following attestation bundles were made for static_http-0.1.2-py3-none-any.whl:
Publisher:
release.yml on pseudosavant/static-http
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
static_http-0.1.2-py3-none-any.whl -
Subject digest:
bcbf17a8307d0e963dfe8b522caeae08c0c14e7458892c220e9eeb2065ec0ed1 - Sigstore transparency entry: 1828075665
- Sigstore integration time:
-
Permalink:
pseudosavant/static-http@780c8d0512cbd6db50a6b864dce37e76301bee3b -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/pseudosavant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@780c8d0512cbd6db50a6b864dce37e76301bee3b -
Trigger Event:
push
-
Statement type: