Skip to main content

A small HTTP file server with directory browsing and uploads.

Project description

simple_http_server

Features

  • ✔ simple
  • ✔ upload
  • ✔ batch upload
  • ✔ download
  • ✔ support python2, python3
  • ✔ Multi-threaded

Usage

# get code
$ git clone https://github.com/freelamb/simple_http_server.git

# enter directory
$ cd simple_http_server

# run server
$ python simple_http_server.py 8000

# expose to another host in a trusted network
$ python simple_http_server.py --bind 0.0.0.0 8000

Install from PyPI after a release is published:

$ python -m pip install simple-http-server-upload
$ simple-http-server-upload 8000
# run as docker container
# 1.build the image('.' below refer to the root path of this project)
docker build -t freelamb/simple_http_server .
# 2.run the container using the image built just now in docker 
docker run 
  --name simple_http_server \ 
  -p 8000:8000 \ 
  -v /opt/data:/opt/data \ 
  -d freelamb/simple_http_server:latest

Security

This server is intended for temporary file sharing in trusted environments. The default bind address is 127.0.0.1; use --bind 0.0.0.0 only when you explicitly want other hosts to connect.

Uploaded file names are sanitized, upload results and directory listings escape user-controlled text, and upload requests larger than 100 MiB are rejected.

Example

Todo

  • add docker images

Contributing

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
  2. Fork the repository_ on GitHub to start making your changes to the master branch (or branch off of it).
  3. Write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.

Changelog

Changelog

reference

https://github.com/tualatrix/tools/blob/master/SimpleHTTPServerWithUpload.py

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

simple_http_server_upload-0.3.4.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_http_server_upload-0.3.4-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file simple_http_server_upload-0.3.4.tar.gz.

File metadata

File hashes

Hashes for simple_http_server_upload-0.3.4.tar.gz
Algorithm Hash digest
SHA256 93492d5ef897306a3699c265578d21f5c6fb250b23e5ef032b7647eea0c2831d
MD5 3f7a09d9db551be70844e15fd6fb89b0
BLAKE2b-256 3c0305b1f327d57fb329e60771e5e98506e975e61c5da0e8eb095bf5af27abe0

See more details on using hashes here.

File details

Details for the file simple_http_server_upload-0.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_http_server_upload-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cbeb888016056904441b91f57b5617a86a2c125f4d4865a8ae27e850d92e5b27
MD5 ab6269639433c99021d4485b85684610
BLAKE2b-256 836d62c0a7ea349cafa51b227e3ba18ba1ffda3e3de123132f88af6af4e4a87b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page