Registry / http-networking / rangehttpserver

rangehttpserver

JSON →
library1.4.0pypypi✓ verified 24d ago

RangeHTTPServer is a Python module that provides a simple HTTP server with support for HTTP Range requests, extending Python's built-in SimpleHTTPServer. It enables clients to request portions of files, which is particularly useful for media streaming, download managers, or local web development involving large data files. The project is sporadically maintained but active, with its latest version 1.4.0 released in August 2024.

pip install rangehttpserver
INSTALL
IMPORT
SIG · RANGEHTTPSERVER
R
rangehttpserver
http-networkingpythonv1.4.0
Install
1.6s avg
Import
113ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.118s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.108s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RangeRequestHandler
from RangeHTTPServer import RangeRequestHandler
from rangehttpserver import RangeRequestHandler
SimpleHTTPRequestHandler
from RangeHTTPServer import SimpleHTTPRequestHandler
parse_byte_range
from RangeHTTPServer import parse_byte_range

To start the RangeHTTPServer, navigate to the directory you wish to serve and run it as a module. You can specify a port and, starting with version 1.4.0, a bind address.

python -m rangehttpserver --bind 127.0.0.1 8000 # Access your files at http://127.0.0.1:8000 # For example, create a file: echo 'Hello, Range!' > index.html
Debug
Known issues
gotchaRangeHTTPServer is explicitly designed for local testing and should NOT be used for Internet-scale production environments due to potential security and performance limitations inherent in a simple HTTP server.
fix
For production use, consider robust web servers like Nginx, Apache, or Python frameworks like Flask/Django with appropriate serving mechanisms.
affects: All versions
gotchaThe library's Range header support is partial. It handles basic byte range requests but does not implement the full HTTP Range specification, specifically lacking support for multiple ranges or multipart payloads. Unparsable range requests will result in the entire file being served.
fix
Clients should be aware of this limitation; complex range requests might not behave as expected. Test with your specific client (e.g., media player) to confirm compatibility.
affects: All versions
gotchaIn versions prior to 1.4.0, there was a known issue where specifying a port number from the command line (e.g., `python -m RangeHTTPServer 8080`) might be ignored, defaulting to port 8000. This has been addressed in version 1.4.0 with the addition of explicit `--bind` and port handling.
fix
Upgrade to version 1.4.0 or later to ensure port and bind address arguments are correctly recognized. Always test your command-line arguments if using older versions.
affects: < 1.4.0
Upgrade
Version history
1.4.0latest on PyPI · released Aug 27, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
20
Resources
rangehttpserver — pip install rangehttpserver · libregistry