https://github.com/antoniotejada/zipserver
Multithreaded HTTP server that efficiently serves files from inside a zip archive without having to uncompress them.
https://github.com/antoniotejada/zipserver
http-server httpd pkzip python python2 python27 zip
Last synced: 4 months ago
JSON representation
Multithreaded HTTP server that efficiently serves files from inside a zip archive without having to uncompress them.
- Host: GitHub
- URL: https://github.com/antoniotejada/zipserver
- Owner: antoniotejada
- License: agpl-3.0
- Created: 2024-04-27T22:26:05.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-27T22:26:15.000Z (over 1 year ago)
- Last Synced: 2025-03-12T10:45:51.367Z (7 months ago)
- Topics: http-server, httpd, pkzip, python, python2, python27, zip
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zipserver
Efficient multithreaded HTTP server of static websites stored in zip archives.
## Features
- Serve static files stored in one or more zip archives
- Compressed and uncompressed files inside a zip archive are efficiently served directly from the zip archive without having to copy/uncompress
- Multiple worker threads from a pool
- Open file handle caching (opening and closing files is 2x-3x more costly than reading them).
- Serve default index file or browseable directory lists if there's no index file
- Specify folder to use as root for a given zip archive
- Map zip archives into arbitrary server directories## Running
```
zipserver.py --help
usage: zipserver.py [-h] [-a SERVER_ADDRESS] [-d DEBUGLEVEL] [-i INDEX_FILE]
[-l] [-r ZIP_ROOTDIRS] [-s ZIP_SERVEDIRS] [-t NUM_THREADS]
filepathsLaunch an HTTP server to serve the contents of a zip file
positional arguments:
filepaths comma-separated list of filepaths to the zips to serveoptional arguments:
-h, --help show this help message and exit
-a SERVER_ADDRESS, --address SERVER_ADDRESS
server address in [host][:port] format.
-d DEBUGLEVEL, --debuglevel DEBUGLEVEL
debuglevel to use (DEBUG=10, CRITICAL=50)
-i INDEX_FILE, --index-file INDEX_FILE
default index file
-l, --list-dirs list directories when there's no index file
-r ZIP_ROOTDIRS, --root-dirs ZIP_ROOTDIRS
comma-separated directories inside the zip file for
the server's root (use forward slashes for subdirs).
-s ZIP_SERVEDIRS, --serve-dirs ZIP_SERVEDIRS
comma-separated server directories where to hook this
zip file (use forward slashes for subdirs).
-t NUM_THREADS, --num-threads NUM_THREADS
use n threads to serve requests, 0 to service the
request in the same thread
``````
zipserver.py zip1.zip,zip2.zip -s /zip1,/zip2 -i index.html -l
```