{"id":5452,"library":"rangehttpserver","title":"RangeHTTPServer","description":"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.","status":"active","version":"1.4.0","language":"en","source_language":"en","source_url":"https://github.com/danvk/RangeHTTPServer/","tags":["http-server","range-requests","local-development","simplehttpserver","file-serving"],"install":[{"cmd":"pip install rangehttpserver","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"note":"While a programmatic import is possible, the library is primarily designed for command-line use and its internal `__main__.py` handles its own handler import. Most users interact with it via `python -m`.","symbol":"RangeRequestHandler","correct":"from rangehttpserver import RangeRequestHandler"}],"quickstart":{"code":"python -m rangehttpserver --bind 127.0.0.1 8000\n# Access your files at http://127.0.0.1:8000\n# For example, create a file: echo 'Hello, Range!' > index.html","lang":"bash","description":"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."},"warnings":[{"fix":"For production use, consider robust web servers like Nginx, Apache, or Python frameworks like Flask/Django with appropriate serving mechanisms.","message":"RangeHTTPServer 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"In 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.","severity":"gotcha","affected_versions":"< 1.4.0"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}