Skip to content

whattheslime/httpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTPY 🚀

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.

command

server


✨ Features

  • 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.

📦 Install

Clone the repository and install the package:

git clone https://github.com/WhatTheSlime/httpy.git
cd httpy
python3 -m pip install .

🚀 Usage

1. Start the server

Basic usage (Read-only, production mode):

httpy

Enable editing and SSL (Self-signed certificate):

httpy --edit --ssl

Enable development mode (Flask debugger):

httpy --dev

2. Command Line Arguments

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

🛠️ Advanced: Interacting with HTTPY

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"

🧪 Testing

The project includes a comprehensive test suite using pytest.

# Run all tests
PYTHONPATH=src pytest tests/

🔒 Security & SSL

To use your own SSL certificates:

httpy --ssl --cert cert.pem --key key.pem

To generate a self-signed certificate for local testing:

openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365

About

Simple HTTP server to list and manipulate files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors