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
# 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
- Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
- Fork the repository_ on GitHub to start making your changes to the master branch (or branch off of it).
- Write a test which shows that the bug was fixed or that the feature works as expected.
- Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.
Changelog
reference
https://github.com/tualatrix/tools/blob/master/SimpleHTTPServerWithUpload.py
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_http_server_upload-0.3.6.tar.gz.
File metadata
- Download URL: simple_http_server_upload-0.3.6.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e711b9c83b6a9cb2f4d91c5aef752b4de0803690541a20bb0bcfa8bce0a29c92
|
|
| MD5 |
62539e3ea092a7d1ec5cf80a87057ddd
|
|
| BLAKE2b-256 |
1ef44d0b4badcf065449eabf578094bad15805d4158e02a67649336db337e230
|
File details
Details for the file simple_http_server_upload-0.3.6-py3-none-any.whl.
File metadata
- Download URL: simple_http_server_upload-0.3.6-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbd077cb510663dc17e23c994e395a22b62ade5dec9a8016f0230cd1e359c368
|
|
| MD5 |
11190aa2fa30be789dab037b3ac63b89
|
|
| BLAKE2b-256 |
bd190ca77098ac78ab5be84914adad62eb7c4e3ee4ef70bd25727f49414d7192
|