Skip to content

whattheslime/httpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTPY

Simple HTTP server to list and manipulate files.

The objective of this project is to replace the http.server python module with a Flask server offering more features:

  • Basic Authentication
  • Directory listing
  • Files upload and download
  • Files and directories creation
  • Files and directories deletion
  • SSL encryption (HTTPS)

Install

Clone the repository, go inside and then:

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

Basic usage

  1. Start the server:
httpy --ssl -e
 * Serving Flask app 'httpy'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on https://127.0.0.1:8000
Press CTRL+C to quit

  1. Open in browser:

alt text

Use features with curl

Need --edit flag set on the server.

# Download a file:
curl -ski -O http://127.0.0.1:8000/file.ext
# Download archive of directory:
curl -ski -d '' http://127.0.0.1:8000/?action=archive -o archive.zip
# Create a file:
curl -ski http://127.0.0.1:8000/?action=create -d 'name=filename&content=filecontent'
# Create a directory:
curl -ski http://127.0.0.1:8000/?action=mkdir -d name='dirname'
# Upload files:
curl -ski http://127.0.0.1:8000/?action=upload -F file=@'path/to/file1.ext' -F file=@'path/to/file2.ext'
# Delete files:
curl -ski http://127.0.0.1:8000/?action=delete -d 'file1='filename1&file2=filename2'

Generate SSL certificates

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

About

Simple HTTP server to list and manipulate files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published