Skip to main content

A small HTTP file server with directory browsing and uploads.

Project description

simple_http_server

English | 简体中文

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

# optionally limit upload requests to 1 GiB
$ python simple_http_server.py --max-upload-size 1024 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, and upload results and directory listings escape user-controlled text. Upload size is unlimited by default; use --max-upload-size MIB to set a limit when you need one in trusted environments.

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.6.tar.gz (10.8 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.6-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for simple_http_server_upload-0.3.6.tar.gz
Algorithm Hash digest
SHA256 e711b9c83b6a9cb2f4d91c5aef752b4de0803690541a20bb0bcfa8bce0a29c92
MD5 62539e3ea092a7d1ec5cf80a87057ddd
BLAKE2b-256 1ef44d0b4badcf065449eabf578094bad15805d4158e02a67649336db337e230

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simple_http_server_upload-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cbd077cb510663dc17e23c994e395a22b62ade5dec9a8016f0230cd1e359c368
MD5 11190aa2fa30be789dab037b3ac63b89
BLAKE2b-256 bd190ca77098ac78ab5be84914adad62eb7c4e3ee4ef70bd25727f49414d7192

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