| Crates.io | samserve |
| lib.rs | samserve |
| version | 0.1.1 |
| created_at | 2025-08-05 09:39:15.386686+00 |
| updated_at | 2025-08-05 16:12:27.706177+00 |
| description | A minimal file server with upload support, Basic Auth, and range support. A better drop-in replacement for python3 -m http.server. |
| homepage | https://github.com/3amim/samserve |
| repository | https://github.com/3amim/samserve |
| max_upload_size | |
| id | 1781765 |
| size | 55,787 |
A minimal and efficient static file server designed as a lightweight and feature-rich replacement for python3 -m http.server.
If you've used python3 -m http.server, you know it's handy for quickly serving files over HTTP. However, it lacks:
samserve solves these limitations while remaining simple, fast, and easy to use.
Small binary size:
The release binary is under 3 MB, making it easy to deploy anywhere.
Static file serving:
Serve files from any directory with proper MIME type detection.
Directory listing:
Clean, user-friendly, modern HTML directory listings.
Basic Authentication:
HTTP Basic Auth support to protect your files and uploads.
File uploads:
Upload files via HTTP multipart/form-data.
Range requests:
Efficient large file serving with HTTP range requests support.
Secure by default:
Protects against directory traversal and unauthorized access.
Detailed logging:
Logs requests with method, path, status, and remote address.
Build from source:
cargo build --release
cp target/release/samserve /usr/local/bin/
samserve --root ./public --port 8000 --upload --auth user:password
--root - Root directory to serve (default: .)
--ip - IP address to bind (default: 0.0.0.0)
--port - Port to listen on (default: 8000)
--upload - Enable file upload support
--auth - Enable Basic Auth (username:password)
Serve the public folder on port 8080 with uploads and basic auth:
samserve --root public --port 8080 --upload --auth admin:secret
python3 -m http.server| Feature | python3 -m http.server | samserve |
|---|---|---|
| File upload support | ❌ | ✅ |
| Basic Authentication | ❌ | ✅ |
| Large file streaming | ❌ | ✅ |
| Directory listing | Basic HTML | Modern, styled listing |
| Protection from traversal | No | Yes |
| Binary size | Larger (Python + deps) | < 3 MB |
MIT License