Package: quickhttp
quickhttpquickhttpis a lightweight CLI that wraps Python'shttp.serverwith automatic port-finding and automatic shutdown after a configurable idle duration.FeaturesAutomatically finds and uses an available port.Has a keep-alive time after which it will shut down automatically if no requests are received, in case you forget about it.More secure default of127.0.0.1(localhost) instead of0.0.0.0.Easier to type and autocomplete thanpython -m http.server.InstallationYou can getquickhttpfromPyPI. I recommend usingpipxto manage Python command-line programs:pipxinstallquickhttpYou can also install normally using regularpip:pipinstallquickhttpRequires Python 3.7 or higher. For Python 3.6, installv1.0.0.Development VersionTo install the development version of this program, get it directly from GitHub.pipxinstallgit+https://github.com/jayqi/quickhttp.gitDocumentationquickhttp--helpUsage: quickhttp [OPTIONS] [DIRECTORY]

  Lightweight CLI that wraps Python's `http.server` with automatic port-
  finding and shutdown.

Arguments:
  [DIRECTORY]  Directory to serve.  [default: .]

Options:
  -t, --timeout TEXT              Time to keep server alive for after most
                                  recent request. Accepts time expressions
                                  parsable by pytimeparse, such as '10m' or
                                  '10:00'.  [default: 10m]

  -b, --bind TEXT                 Address to bind server to. '127.0.0.1' (or
                                  'localhost') will only be accessible from
                                  this computer. '0.0.0.0' is all interfaces
                                  (IP addresses) on this computer, meaning
                                  that it can be accessible by other computers
                                  at your IP address.  [default: 127.0.0.1]

  -p, --port INTEGER              Port to use. If None (default), will
                                  automatically search for an open port using
                                  the other port-related options. If
                                  specified, ignores other port-related
                                  options.

  --port-range-min INTEGER        Minimum of range to search for an open port.
                                  [default: 8000]

  --port-range-max INTEGER        Maximum of range to search for an open port.
                                  [default: 8999]

  --port-max-tries INTEGER        Maximum number of ports to check.  [default:
                                  50]

  --port-search-type [sequential|random]
                                  Type of search to use.  [default:
                                  sequential]

  --version                       Show version and exit.
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.

  --help                          Show this message and exit.Why usequickhttp?python -m http.serveris a pain to type.quickhttpis shorter and can autocomplete. (But you can still dopython -m quickhttptoo if you really want to.)If you try startingpython -m http.serverand port 8000 is unavailable, you getOSError: [Errno 48] Address already in use. Then you have to choose another port and try again.quickhttpdeals with ports automatically for you.quickhttpwill 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.python -m http.serverdefaults to 0.0.0.0, which may make your server accessible to other people at your computer's IP address. This is a security vulnerability, but isn't necessarily obvious to people who just want to quickly serve some static files.