{"id":15579130,"url":"https://github.com/jayqi/quickhttp","last_synced_at":"2025-04-24T01:27:46.575Z","repository":{"id":47250054,"uuid":"279184791","full_name":"jayqi/quickhttp","owner":"jayqi","description":"Lightweight CLI that wraps Python's http.server with automatic port-finding and shutdown.","archived":false,"fork":false,"pushed_at":"2024-02-10T05:05:39.000Z","size":2069,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T05:41:12.226Z","etag":null,"topics":["cli","https-server","python","webserver"],"latest_commit_sha":null,"homepage":"https://jayqi.github.io/quickhttp/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jayqi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-07-13T01:59:32.000Z","updated_at":"2021-11-06T18:03:04.000Z","dependencies_parsed_at":"2024-02-03T02:28:23.000Z","dependency_job_id":null,"html_url":"https://github.com/jayqi/quickhttp","commit_stats":{"total_commits":37,"total_committers":2,"mean_commits":18.5,"dds":"0.18918918918918914","last_synced_commit":"58fea827497a29b98ddf5671ead71b0faa4caf11"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayqi%2Fquickhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayqi%2Fquickhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayqi%2Fquickhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayqi%2Fquickhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jayqi","download_url":"https://codeload.github.com/jayqi/quickhttp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250543220,"owners_count":21447854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","https-server","python","webserver"],"created_at":"2024-10-02T19:13:55.938Z","updated_at":"2025-04-24T01:27:46.561Z","avatar_url":"https://github.com/jayqi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quickhttp\n\n[![Docs Status](https://img.shields.io/badge/docs-stable-informational)](https://jayqi.github.io/quickhttp/)\n[![PyPI](https://img.shields.io/pypi/v/quickhttp.svg)](https://pypi.org/project/quickhttp/)\n[![tests](https://github.com/jayqi/quickhttp/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/jayqi/quickhttp/actions/workflows/tests.yml?query=workflow%3Atests+branch%3Amain)\n[![codecov](https://codecov.io/gh/jayqi/quickhttp/branch/main/graph/badge.svg)](https://codecov.io/gh/jayqi/quickhttp)\n\n`quickhttp` is a lightweight CLI that wraps Python's `http.server` with automatic port-finding and automatic shutdown after a configurable idle duration.\n\n## Features\n\n- Automatically finds and uses an available port.\n- Has a keep-alive time after which it will shut down automatically if no requests are received, in case you forget about it.\n- More secure default of `127.0.0.1` (`localhost`) instead of `0.0.0.0`.\n- Easier to type and autocomplete than `python -m http.server`.\n\n## Installation\n\nIf you're using [uv](https://docs.astral.sh/uv/), you can immediately run it without installing by using `uvx`:\n\n```bash\nuvx quickhttp\n```\n\nTo install it to be available for later use, you can use any method that installs from [PyPI](https://pypi.org/project/quickhttp/). I recommend using [`uv tool`](https://docs.astral.sh/uv/guides/tools/) or [`pipx`](https://pipxproject.github.io/pipx/) to manage Python command-line programs.\n\n\u003c!-- Installation start --\u003e\n```bash\nuvx quickhttp\n# or\nuv tool install quickhttp\n# or\npipx install quickhttp\n# or\npip install quickhttp\n```\n\u003c!-- Installation end --\u003e\n\n\n### Development Version\n\nTo run the development version of this program, get it directly from GitHub.\n\n```bash\nuvx \"quickhttp @ git+https://github.com/jayqi/quickhttp.git\"\n```\n\n## Documentation\n\n```bash\nquickhttp --help\n```\n\n```text\nUsage: quickhttp [OPTIONS] [DIRECTORY]\n\n  Lightweight CLI that wraps Python's `http.server` with automatic port-\n  finding and shutdown.\n\nArguments:\n  [DIRECTORY]  Directory to serve.  [default: .]\n\nOptions:\n  -t, --timeout TEXT              Time to keep server alive for after most\n                                  recent request. Accepts time expressions\n                                  parsable by pytimeparse, such as '10m' or\n                                  '10:00'.  [default: 10m]\n\n  -b, --bind TEXT                 Address to bind server to. '127.0.0.1' (or\n                                  'localhost') will only be accessible from\n                                  this computer. '0.0.0.0' is all interfaces\n                                  (IP addresses) on this computer, meaning\n                                  that it can be accessible by other computers\n                                  at your IP address.  [default: 127.0.0.1]\n\n  -p, --port INTEGER              Port to use. If None (default), will\n                                  automatically search for an open port using\n                                  the other port-related options. If\n                                  specified, ignores other port-related\n                                  options.\n\n  --port-range-min INTEGER        Minimum of range to search for an open port.\n                                  [default: 8000]\n\n  --port-range-max INTEGER        Maximum of range to search for an open port.\n                                  [default: 8999]\n\n  --port-max-tries INTEGER        Maximum number of ports to check.  [default:\n                                  50]\n\n  --port-search-type [sequential|random]\n                                  Type of search to use.  [default:\n                                  sequential]\n\n  --version                       Show version and exit.\n  --install-completion [bash|zsh|fish|powershell|pwsh]\n                                  Install completion for the specified shell.\n  --show-completion [bash|zsh|fish|powershell|pwsh]\n                                  Show completion for the specified shell, to\n                                  copy it or customize the installation.\n\n  --help                          Show this message and exit.\n```\n\n## Why use `quickhttp`?\n\n- `python -m http.server` is a pain to type. `quickhttp` is shorter and can autocomplete. (But you can still do `python -m quickhttp` too if you really want to.)\n- If you try starting `python -m http.server` and port 8000 is unavailable, you get `OSError: [Errno 48] Address already in use`. Then you have to choose another port and try again. `quickhttp` deals with ports automatically for you.\n- `quickhttp` will automatically shutdown after the keep-alive time expires. This defaults to 10 minutes. I often start up an HTTP server to look at something, then open a new tab to continue doing things, and then I forget about the server.\n- `python -m http.server` defaults to 0.0.0.0, which may make your server accessible to other people at your computer's IP address. This can be a security vulnerability, but isn't necessarily obvious to people who just want to quickly serve some static files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayqi%2Fquickhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjayqi%2Fquickhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayqi%2Fquickhttp/lists"}