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
Metadata
Release files for simple-http-server-upload 0.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| simple_http_server_upload-0.3.6.tar.gz | 10.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simple_http_server_upload-0.3.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.1 kB
Release files / simple_http_server_upload-0.3.6.tar.gz
| Download URL | simple_http_server_upload-0.3.6.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e711b9c83b6a9cb2f4d91c5aef752b4de0803690541a20bb0bcfa8bce0a29c92
|
|
BLAKE2b-256 checksum How to use checksums |
1ef44d0b4badcf065449eabf578094bad15805d4158e02a67649336db337e230
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / simple_http_server_upload-0.3.6-py3-none-any.whl
| Download URL | simple_http_server_upload-0.3.6-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbd077cb510663dc17e23c994e395a22b62ade5dec9a8016f0230cd1e359c368
|
|
BLAKE2b-256 checksum How to use checksums |
bd190ca77098ac78ab5be84914adad62eb7c4e3ee4ef70bd25727f49414d7192
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|