Simple yet powerful HTTP server to list and manipulate files, built with Flask and Waitress.
The objective of this project is to replace Python's default http.server with a more feature-rich, secure, and production-ready solution.
- Production-Ready: Uses Waitress by default for robustness.
- File Manipulation: Create, upload, download (ZIP), and delete files/dirs.
- Security: Path traversal protection, Basic Auth, and SSL support.
- Modern UI: Human-readable file sizes and intuitive navigation.
- Logging: Action tracking with user IP and timestamps.
- Developer Friendly: Flask debug mode available via
--dev.
Clone the repository and install the package:
git clone https://github.com/WhatTheSlime/httpy.git
cd httpy
python3 -m pip install .Basic usage (Read-only, production mode):
httpyEnable editing and SSL (Self-signed certificate):
httpy --edit --sslEnable development mode (Flask debugger):
httpy --dev| Argument | Short | Description |
|---|---|---|
--directory |
-d |
Target directory to serve (default: current) |
--edit |
-e |
Enable file/directory manipulation |
--dev |
Use Flask development server with debug mode | |
--auth |
-a |
Setup Basic Auth (USER PASSWORD) |
--bind |
-b |
Bind address (default: 0.0.0.0) |
--port |
-p |
Port number (default: 8000) |
--ssl |
-s |
Enable SSL encryption |
You can perform all actions using curl (Server must be started with --edit):
# Download a file
curl -O http://127.0.0.1:8000/README.md
# Upload files
curl -F "file=@/path/to/local_file.txt" "http://localhost:8000/?action=upload"
# Create a new file
curl -d "name=notes.txt&content=Hello+HTPPY" "http://localhost:8000/?action=create"
# Create a directory
curl -d "name=projects" "http://localhost:8000/?action=mkdir"
# Delete files
curl -d "file0=notes.txt" "http://localhost:8000/?action=delete"
# Download directory as ZIP
curl -o backup.zip "http://localhost:8000/?action=archive"The project includes a comprehensive test suite using pytest.
# Run all tests
PYTHONPATH=src pytest tests/To use your own SSL certificates:
httpy --ssl --cert cert.pem --key key.pemTo generate a self-signed certificate for local testing:
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
