goto-http-redirect-server


Namegoto-http-redirect-server JSON
Version 1.2.1 PyPI version JSON
download
home_pagehttps://pypi.org/project/goto-http-redirect-server/
SummaryThe "Go To" HTTP Redirect Server for sharing dynamic shortcut URLs on your network.
upload_time2022-12-31 01:35:20
maintainer
docs_urlNone
authorjtmoon79
requires_python>=3.6
licenseMIT License
keywords http-server redirect-urls shortcuts shorturl shorturl-servicesshorturls url-shortener
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Go To HTTP Redirect Server

[![CircleCI](https://img.shields.io/circleci/build/gh/jtmoon79/goto_http_redirect_server.svg?logo=circleci&logoColor=black&style=flat-square)](https://circleci.com/gh/jtmoon79/goto_http_redirect_server)
[![Azure Build Status](https://img.shields.io/azure-devops/build/jtmmoon/goto_http_redirect_server/1?branchName=master&logo=azurepipelines&style=flat-square)](https://dev.azure.com/jtmmoon/goto_http_redirect_server/_build/latest?definitionId=1&branchName=master)
[![pytest-cov Code Coverage](https://img.shields.io/azure-devops/coverage/jtmmoon/goto_http_redirect_server/1?logo=azurepipelines&style=flat-square)](https://dev.azure.com/jtmmoon/goto_http_redirect_server/_build?definitionId=1&_a=summary)
[![PyPi version](https://img.shields.io/pypi/v/goto-http-redirect-server.svg?longCache=True&logo=pypi&color=blue&style=flat-square)](https://pypi.org/pypi/goto-http-redirect-server/)
[![Commits since](https://img.shields.io/github/commits-since/jtmoon79/goto_http_redirect_server/latest.svg?logo=github)](https://img.shields.io/github/commits-since/jtmoon79/goto_http_redirect_server/latest.svg)
[![Python versions](https://img.shields.io/pypi/pyversions/goto-http-redirect-server.svg?longCache=True&logo=python)](https://pypi.org/pypi/goto-http-redirect-server/)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

The **_"Go To" HTTP Redirect Server_** for sharing dynamic shortcut URLs
on your network.

Trivial to install and run.  Only uses Python built-in modules.  Super handy 😄 ‼

----

<!-- TOC updated by VS Code extension Markdown All In One -->

- [Go To HTTP Redirect Server](#go-to-http-redirect-server)
  - [Install Manually](#install-manually)
  - [Install systemd Service](#install-systemd-service)
- [Use](#use)
  - [Gotchas](#gotchas)
  - [Live Reload](#live-reload)
    - [Reload via Signals](#reload-via-signals)
    - [Reload automatically using signals and `goto-http-redirect-server-inotify.sh`](#reload-automatically-using-signals-and-goto-http-redirect-server-inotifysh)
    - [Reload via browser](#reload-via-browser)
  - [systemd Service](#systemd-service)
  - [Pro Tips](#pro-tips)
- [`--help` message](#--help-message)

----

## Install Manually

1. create a tab-separated values file (`'\t'`) with a list of HTTP redirects.<br />
   Fields are "_from path_", "_to URL_", "_added by user_", and "_added on datetime_".<br />
   For example, given a file `./redirects1.csv`

       /bug	https://bugtracker.megacorp.local/view.cgi=${query}	alice	2019-08-10 00:05:10
       /hr	http://human-resources.megacorp.local/login	bob	2018-07-11 22:15:10
       /aws	https://us-west-2.console.aws.amazon.com/console/home?region=us-west-2#	carl	2019-01-05 12:35:10

2. Install (pick one)

    - pip install official release from pypi.org

          pip install goto-http-redirect-server

    - pip install latest code from github

          pip install "https://github.com/jtmoon79/goto_http_redirect_server/archive/master.zip"

    - Download from github and run

          curl "https://raw.githubusercontent.com/jtmoon79/goto_http_redirect_server/master/goto_http_redirect_server/goto_http_redirect_server.py"
          python goto_http_redirect_server.py --version

    - use [`pip-run`](https://pypi.org/project/pip-run/)

          pip-run --use-pep517 --quiet "git+https://github.com/jtmoon79/goto_http_redirect_server" -- \
              -m goto_http_redirect_server --version

    - Build and install using helper scripts [`tools/build-install.sh`](./tools/build-install.sh) or [`tools/build-install.ps1`](./tools/build-install.ps1)

          git clone "https://github.com/jtmoon79/goto_http_redirect_server.git"
          goto_http_redirect_server/tools/build-install.sh

    - Build and install

          git clone "https://github.com/jtmoon79/goto_http_redirect_server.git"
          cd goto_http_redirect_server
          python setup.py bdist_wheel
          python -m pip install --user ./dist/goto_http_redirect_server-*-py3-none-any.whl

3. start the _Go To HTTP Redirect Server_

        goto_http_redirect_server --redirects ./redirects1.csv

    or run as a module

        python -m goto_http_redirect_server --redirects ./redirects1.csv

    Requires at least Python version 3.6.

## Install systemd Service

See [service/README.md](./service/README.md).

# Use

From your browser, browse to a redirect path!  For example, given a network host
`goto` running `goto_http_redirect_server` on port `80`, and given the
example redirects file `./redirects1.csv` above, then<br />
in your browser, type **`goto/hr⏎`**. Your browser will end up at
**`http://human-resources.megacorp.local/login`** 😆‼<br />
Try  **`goto/bug?456⏎`**… shows bug 456 😝❗❗

## Gotchas

<small>

- Some browsers will assume a single word host, e.g. `goto/hr`, is a
  search engine query, i.e. the browser will query Google for "`goto/hr`".
  Type in a prepended http protocol, e.g. `http://goto/hr⏎`.\*\*

- In most corporate networks, a user's workstation will DNS search the corporate
  domain, e.g. `.local`.  This allows users to enter browser URL
  `goto/hr` which will resolve to host `goto.local`. Sometimes workstations
  do not search the corporate domain due to DNS Search Order setting not
  including `.local`. In that case, the user must specify the domain, e.g.
  instead of typing `goto/hr⏎`, the user must type `goto.local/hr⏎`.\*\*

\*\* _Mileage May Vary_ 😔

</small>

## Live Reload

When the tab-separated values files are modified, this program can reload them.
No service downtime!

### Reload via Signals

1. Note during startup the Process ID (or query the host System).

2. Send the process signal to the running `goto_http_redirect_server`.<br />
   In Unix, use `kill`.<br />
   In Windows, use [`windows-kill.exe`](https://github.com/alirdn/windows-kill/releases)<br />
   The running `goto_http_redirect_server` will re-read all files passed via
   `--redirects`.

### Reload automatically using signals and `goto-http-redirect-server-inotify.sh`

1. On Linux, run the script [`goto-http-redirect-server-inotify.sh`](./tools/goto-http-redirect-server-inotify.sh)
   setting variables as needed.
   This script needs some work, but it functions.

### Reload via browser

1. Pass `--reload-path /reload` as a program command-line options.

2. Browse to `http://host/reload`.

## systemd Service

- See  [`service/`](./service) directory for systemd service files.

## Pro Tips

- Add a DNS addressable host on your network named `goto`. Run
  `goto_http_redirect_server` on the host.<br />
  Network users can type in their browser address bar `goto/…⏎` to easily use
  the _"Go To" HTTP Redirect Server_.\*\*

- There are many methods to secure a running process.
  One method is to use `authbind` to run `goto_http_redirect_server` as a low
  privilege process.

      apt install authbind
      touch /etc/authbind/byport/80
      chown nobody /etc/authbind/byport/80
      chmod 0500 /etc/authbind/byport/80
      sudo -u nobody -- authbind --deep python goto_http_redirect_server …

  This is an optional setting in [the systemd service](./service/).

<br />

----

# `--help` message

```text
usage: goto_http_redirect_server [--redirects REDIRECTS_FILES] [--from-to from to] [--ip IP]
                                 [--port PORT] [--status-path STATUS_PATH]
                                 [--reload-path RELOAD_PATH] [--redirect-code REDIRECT_CODE]
                                 [--field-delimiter FIELD_DELIMITER]
                                 [--status-note-file STATUS_NOTE_FILE] [--no-cache]
                                 [--shutdown SHUTDOWN] [--log LOG] [--debug] [--version] [-?]

The "Go To" HTTP Redirect Server for sharing dynamic shortcut URLs on your network.

HTTP 307 Temporary Redirect reply server. Load this server with redirects of "from path" and
"to URL" and let it run indefinitely. Reload the running server by signaling the
process or HTTP requesting the RELOAD_PATH.

Redirects:
  One or more required. May be passed multiple times.

  --redirects REDIRECTS_FILES
                        File of redirects. Within a file, is one redirect entry per line. A
                        redirect entry is four fields: "from path", "to URL", "added by user", and
                        "added on datetime" separated by the FIELD_DELIMITER character.
  --from-to from to     A single redirect entry of "from path" and "to URL" fields. For example,
                        --from-to "/hr" "http://human-resources.megacorp.local/login"

Network Options:
  --ip IP, -i IP        IP interface to listen on. Default is 0.0.0.0 .
  --port PORT, -p PORT  IP port to listen on. Default is 80 .

Server Options:
  --status-path STATUS_PATH
                        The status path dumps information about the process and loaded redirects.
                        Default status page path is "/status".
  --reload-path RELOAD_PATH
                        Allow reloads by HTTP GET Request to passed URL Path. e.g. --reload-path
                        "/reload". May be a potential security or stability issue. The program will
                        always allow reload by process signal. Default is off.
  --redirect-code REDIRECT_CODE
                        Set HTTP Redirect Status Code as an integer. Most often the desired
                        override will be 307 (Temporary Redirect). Keep in mind, Status Code
                        Permanent Redirect will cause most browsers to cache the redirect. Any HTTP
                        Status Code could be used but odd things will happen if a value like 500 is
                        returned. This Status Code is only returned when a loaded redirect entry is
                        found and returned. Default successful redirect Status Code is 307
                        (Temporary Redirect).
  --field-delimiter FIELD_DELIMITER
                        Field delimiter string for --redirects files per-line redirect entries.
                        Default is "\t" (ordinal 9).
  --status-note-file STATUS_NOTE_FILE
                        Status page note: Filesystem path to a file with HTML that will be embedded
                        within a <div> element in the status page.
  --no-cache            Turn off caching. Caching will store finalized 'To:' Header URLs in process
                        memory. If users are expected to pass secrets (e.g. a password in a URL
                        parameter) then turn off caching.
  --shutdown SHUTDOWN   Shutdown the server after passed seconds. Intended for testing.
  --log LOG             Log to file at path LOG. Default logging is to sys.stderr.
  --debug               Set logging level to DEBUG. Default logging level is INFO.
  --version             Print "goto_http_redirect_server 1.2.1" and exit.
  -?, -h, --help        Print this help message and exit.

About Redirect Entries:

  Entries found in --redirects file(s) and entries passed via --from-to are
  combined.
  Entries passed via --from-to override any matching "from path" entry found in
  redirects files.
  The "from path" field corresponds to the URI Path in the originating request.
  The "to URL" field corresponds to HTTP Header "Location" in the server
  Redirect reply.

  A redirects file entry has four fields separated by FIELD_DELIMITER character:
  "from path", "to URL", "added by user", "added on datetime".
  For example,

    /hr http://human-resources.megacorp.local/login     bob     2019-09-07 12:00:00

  The last two fields, "added by user" and "added on datetime", are intended
  for record-keeping within an organization.

  A passed redirect should have a leading "/" as this is the URI path given for
  processing.
  For example, the URL "http://host/hr" is processed as URI path "/hr".

  A redirect will combine the various incoming URI parts.
  For example, given redirect entry:

    /b  http://bug-tracker.megacorp.local/view.cgi      bob     2019-09-07 12:00:00

  And incoming GET or HEAD request:

    http://goto/b?id=123

  will result in a redirect URL:

    http://bug-tracker.megacorp.local/view.cgi?id=123

Redirect Entry Template Syntax ("dynamic" URLs):

  Special substrings with Python string.Template syntax may be set in the
  redirect entry "To" field.

  First, given the URL

     http://host.com/pa/th;parm?a=A&b=B#frag

  the URI parts that form a urllib.urlparse ParseResult class would be:

    ParseResult(scheme='http', netloc='host.com', path='/pa/th',
                params='parm', query='a=A&b=B', fragment='frag')

  So then given redirect entry:

    /b  http://bug-tracker.megacorp.local/view.cgi?id=${query}  bob     2019-09-07 12:00:00

  and the incoming GET or HEAD request:

    http://goto/b?123

  Substring '123' is the 'query' part of the ParseResult. The resultant redirect
  URL would become:

    http://bug-tracker.megacorp.local/view.cgi?id=123

Redirect Entry Required Request Modifiers:

  Ending the Redirect Entry "from path" field with various URI separators allows
  preferences for which Redirect Entry to use. The purpose is to allow
  preferring a different Redirect Entry depending upon the users request.

  Given redirect entries:

    /b? http://bug-tracker.megacorp.local/view.cgi?id=${query}  bob     2019-09-07 12:00:00
    /b  http://bug-tracker.megacorp.local/main  bob     2019-09-07 12:00:00

  and the incoming GET or HEAD request:

    http://goto/b?123

  This will choose the first Redirect Entry and return 'Location' header

    http://bug-tracker.megacorp.local/view.cgi?id=123

  Whereas the incoming GET or HEAD request:

    http://goto/b

  This will choose the second Redirect Entry and return 'Location' header

    http://bug-tracker.megacorp.local/main

  The example combination sends a basic request for '/b' to some static page and
  a particular query request '/b?123' to a particular query path.
  Failed matches will "fallback" to the basic Redirect Entry, e.g. the Entry
  without any Required Request Modifiers.

  A Redirect Entry with Required Request Modifier will not match a request
  without such a modifier.

  Given redirect entries:

    /b? http://bug-tracker.megacorp.local/view.cgi?id=${query}  bob     2019-09-07 12:00:00

  and the incoming GET or HEAD request:

    http://goto/b

  will return 404 NOT FOUND.

  Required Request Modifiers must be at the end of the "from path" field string.
  Required Request Modifiers strings are:

     ';'  for user requests with a parameter.
     '?'  for user requests with a query.
     ';?' for user requests with a parameter and a query.

About Redirect Files:

   A line with a leading "#" will be ignored.

About Reloads:

  Sending a process signal to the running process will cause
  a reload of any files passed via --redirects.  This allows live updating of
  redirect information without disrupting the running server process.
  On Unix, the signal is SIGUSR1.  On Windows, the signal is SIGBREAK.
  On this system, the signal is Signals.SIGUSR1 (10).
  On Unix, use program `kill`.  On Windows, use program `windows-kill.exe`.

  A reload of redirect files may also be requested via passed URL path
  RELOAD_PATH.

About Paths:

  Options --status-path and --reload-path may be passed paths to obscure access
  from unauthorized users. e.g.

      --status-path '/62aa687a-c75d-47a5-b76f-4e33ea776e4b'

About this program:

  Underlying caching is so HTTP Redirect responses are a little bit faster.

  Modules used are available within the standard CPython distribution.
  Written for Python 3.7 but hacked to run with at least Python 3.6.
```

----

This project is released under [an MIT License granted by Dell Incorporated's
Open Source Project program](./LICENSE). All project contributions are entirely
reflective of the respective author(s) and not of Dell Inc.

Some portions of Javascript code in this project are subject to
[a separate MIT License](https://kryogenix.org/code/browser/licence.html).

----

<a href="https://stackexchange.com/users/216253/"><img src="https://stackexchange.com/users/flair/216253.png" width="208" height="58" alt="profile for @JamesThomasMoon on Stack Exchange, a network of free, community-driven Q&amp;A sites" title="profile for @JamesThomasMoon on Stack Exchange, a network of free, community-driven Q&amp;A sites" /></a>

            

Raw data

            {
    "_id": null,
    "home_page": "https://pypi.org/project/goto-http-redirect-server/",
    "name": "goto-http-redirect-server",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "http-server redirect-urls shortcuts shorturl shorturl-servicesshorturls url-shortener",
    "author": "jtmoon79",
    "author_email": "",
    "download_url": "",
    "platform": null,
    "description": "\n# Go To HTTP Redirect Server\n\n[![CircleCI](https://img.shields.io/circleci/build/gh/jtmoon79/goto_http_redirect_server.svg?logo=circleci&logoColor=black&style=flat-square)](https://circleci.com/gh/jtmoon79/goto_http_redirect_server)\n[![Azure Build Status](https://img.shields.io/azure-devops/build/jtmmoon/goto_http_redirect_server/1?branchName=master&logo=azurepipelines&style=flat-square)](https://dev.azure.com/jtmmoon/goto_http_redirect_server/_build/latest?definitionId=1&branchName=master)\n[![pytest-cov Code Coverage](https://img.shields.io/azure-devops/coverage/jtmmoon/goto_http_redirect_server/1?logo=azurepipelines&style=flat-square)](https://dev.azure.com/jtmmoon/goto_http_redirect_server/_build?definitionId=1&_a=summary)\n[![PyPi version](https://img.shields.io/pypi/v/goto-http-redirect-server.svg?longCache=True&logo=pypi&color=blue&style=flat-square)](https://pypi.org/pypi/goto-http-redirect-server/)\n[![Commits since](https://img.shields.io/github/commits-since/jtmoon79/goto_http_redirect_server/latest.svg?logo=github)](https://img.shields.io/github/commits-since/jtmoon79/goto_http_redirect_server/latest.svg)\n[![Python versions](https://img.shields.io/pypi/pyversions/goto-http-redirect-server.svg?longCache=True&logo=python)](https://pypi.org/pypi/goto-http-redirect-server/)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nThe **_\"Go To\" HTTP Redirect Server_** for sharing dynamic shortcut URLs\non your network.\n\nTrivial to install and run.  Only uses Python built-in modules.  Super handy \ud83d\ude04 \u203c\n\n----\n\n<!-- TOC updated by VS Code extension Markdown All In One -->\n\n- [Go To HTTP Redirect Server](#go-to-http-redirect-server)\n  - [Install Manually](#install-manually)\n  - [Install systemd Service](#install-systemd-service)\n- [Use](#use)\n  - [Gotchas](#gotchas)\n  - [Live Reload](#live-reload)\n    - [Reload via Signals](#reload-via-signals)\n    - [Reload automatically using signals and `goto-http-redirect-server-inotify.sh`](#reload-automatically-using-signals-and-goto-http-redirect-server-inotifysh)\n    - [Reload via browser](#reload-via-browser)\n  - [systemd Service](#systemd-service)\n  - [Pro Tips](#pro-tips)\n- [`--help` message](#--help-message)\n\n----\n\n## Install Manually\n\n1. create a tab-separated values file (`'\\t'`) with a list of HTTP redirects.<br />\n   Fields are \"_from path_\", \"_to URL_\", \"_added by user_\", and \"_added on datetime_\".<br />\n   For example, given a file `./redirects1.csv`\n\n       /bug\thttps://bugtracker.megacorp.local/view.cgi=${query}\talice\t2019-08-10 00:05:10\n       /hr\thttp://human-resources.megacorp.local/login\tbob\t2018-07-11 22:15:10\n       /aws\thttps://us-west-2.console.aws.amazon.com/console/home?region=us-west-2#\tcarl\t2019-01-05 12:35:10\n\n2. Install (pick one)\n\n    - pip install official release from pypi.org\n\n          pip install goto-http-redirect-server\n\n    - pip install latest code from github\n\n          pip install \"https://github.com/jtmoon79/goto_http_redirect_server/archive/master.zip\"\n\n    - Download from github and run\n\n          curl \"https://raw.githubusercontent.com/jtmoon79/goto_http_redirect_server/master/goto_http_redirect_server/goto_http_redirect_server.py\"\n          python goto_http_redirect_server.py --version\n\n    - use [`pip-run`](https://pypi.org/project/pip-run/)\n\n          pip-run --use-pep517 --quiet \"git+https://github.com/jtmoon79/goto_http_redirect_server\" -- \\\n              -m goto_http_redirect_server --version\n\n    - Build and install using helper scripts [`tools/build-install.sh`](./tools/build-install.sh) or [`tools/build-install.ps1`](./tools/build-install.ps1)\n\n          git clone \"https://github.com/jtmoon79/goto_http_redirect_server.git\"\n          goto_http_redirect_server/tools/build-install.sh\n\n    - Build and install\n\n          git clone \"https://github.com/jtmoon79/goto_http_redirect_server.git\"\n          cd goto_http_redirect_server\n          python setup.py bdist_wheel\n          python -m pip install --user ./dist/goto_http_redirect_server-*-py3-none-any.whl\n\n3. start the _Go To HTTP Redirect Server_\n\n        goto_http_redirect_server --redirects ./redirects1.csv\n\n    or run as a module\n\n        python -m goto_http_redirect_server --redirects ./redirects1.csv\n\n    Requires at least Python version 3.6.\n\n## Install systemd Service\n\nSee [service/README.md](./service/README.md).\n\n# Use\n\nFrom your browser, browse to a redirect path!  For example, given a network host\n`goto` running `goto_http_redirect_server` on port `80`, and given the\nexample redirects file `./redirects1.csv` above, then<br />\nin your browser, type **`goto/hr\u23ce`**. Your browser will end up at\n**`http://human-resources.megacorp.local/login`** \ud83d\ude06\u203c<br />\nTry  **`goto/bug?456\u23ce`**\u2026 shows bug 456 \ud83d\ude1d\u2757\u2757\n\n## Gotchas\n\n<small>\n\n- Some browsers will assume a single word host, e.g. `goto/hr`, is a\n  search engine query, i.e. the browser will query Google for \"`goto/hr`\".\n  Type in a prepended http protocol, e.g. `http://goto/hr\u23ce`.\\*\\*\n\n- In most corporate networks, a user's workstation will DNS search the corporate\n  domain, e.g. `.local`.  This allows users to enter browser URL\n  `goto/hr` which will resolve to host `goto.local`. Sometimes workstations\n  do not search the corporate domain due to DNS Search Order setting not\n  including `.local`. In that case, the user must specify the domain, e.g.\n  instead of typing `goto/hr\u23ce`, the user must type `goto.local/hr\u23ce`.\\*\\*\n\n\\*\\* _Mileage May Vary_ \ud83d\ude14\n\n</small>\n\n## Live Reload\n\nWhen the tab-separated values files are modified, this program can reload them.\nNo service downtime!\n\n### Reload via Signals\n\n1. Note during startup the Process ID (or query the host System).\n\n2. Send the process signal to the running `goto_http_redirect_server`.<br />\n   In Unix, use `kill`.<br />\n   In Windows, use [`windows-kill.exe`](https://github.com/alirdn/windows-kill/releases)<br />\n   The running `goto_http_redirect_server` will re-read all files passed via\n   `--redirects`.\n\n### Reload automatically using signals and `goto-http-redirect-server-inotify.sh`\n\n1. On Linux, run the script [`goto-http-redirect-server-inotify.sh`](./tools/goto-http-redirect-server-inotify.sh)\n   setting variables as needed.\n   This script needs some work, but it functions.\n\n### Reload via browser\n\n1. Pass `--reload-path /reload` as a program command-line options.\n\n2. Browse to `http://host/reload`.\n\n## systemd Service\n\n- See  [`service/`](./service) directory for systemd service files.\n\n## Pro Tips\n\n- Add a DNS addressable host on your network named `goto`. Run\n  `goto_http_redirect_server` on the host.<br />\n  Network users can type in their browser address bar `goto/\u2026\u23ce` to easily use\n  the _\"Go To\" HTTP Redirect Server_.\\*\\*\n\n- There are many methods to secure a running process.\n  One method is to use `authbind` to run `goto_http_redirect_server` as a low\n  privilege process.\n\n      apt install authbind\n      touch /etc/authbind/byport/80\n      chown nobody /etc/authbind/byport/80\n      chmod 0500 /etc/authbind/byport/80\n      sudo -u nobody -- authbind --deep python goto_http_redirect_server \u2026\n\n  This is an optional setting in [the systemd service](./service/).\n\n<br />\n\n----\n\n# `--help` message\n\n```text\nusage: goto_http_redirect_server [--redirects REDIRECTS_FILES] [--from-to from to] [--ip IP]\n                                 [--port PORT] [--status-path STATUS_PATH]\n                                 [--reload-path RELOAD_PATH] [--redirect-code REDIRECT_CODE]\n                                 [--field-delimiter FIELD_DELIMITER]\n                                 [--status-note-file STATUS_NOTE_FILE] [--no-cache]\n                                 [--shutdown SHUTDOWN] [--log LOG] [--debug] [--version] [-?]\n\nThe \"Go To\" HTTP Redirect Server for sharing dynamic shortcut URLs on your network.\n\nHTTP 307 Temporary Redirect reply server. Load this server with redirects of \"from path\" and\n\"to URL\" and let it run indefinitely. Reload the running server by signaling the\nprocess or HTTP requesting the RELOAD_PATH.\n\nRedirects:\n  One or more required. May be passed multiple times.\n\n  --redirects REDIRECTS_FILES\n                        File of redirects. Within a file, is one redirect entry per line. A\n                        redirect entry is four fields: \"from path\", \"to URL\", \"added by user\", and\n                        \"added on datetime\" separated by the FIELD_DELIMITER character.\n  --from-to from to     A single redirect entry of \"from path\" and \"to URL\" fields. For example,\n                        --from-to \"/hr\" \"http://human-resources.megacorp.local/login\"\n\nNetwork Options:\n  --ip IP, -i IP        IP interface to listen on. Default is 0.0.0.0 .\n  --port PORT, -p PORT  IP port to listen on. Default is 80 .\n\nServer Options:\n  --status-path STATUS_PATH\n                        The status path dumps information about the process and loaded redirects.\n                        Default status page path is \"/status\".\n  --reload-path RELOAD_PATH\n                        Allow reloads by HTTP GET Request to passed URL Path. e.g. --reload-path\n                        \"/reload\". May be a potential security or stability issue. The program will\n                        always allow reload by process signal. Default is off.\n  --redirect-code REDIRECT_CODE\n                        Set HTTP Redirect Status Code as an integer. Most often the desired\n                        override will be 307 (Temporary Redirect). Keep in mind, Status Code\n                        Permanent Redirect will cause most browsers to cache the redirect. Any HTTP\n                        Status Code could be used but odd things will happen if a value like 500 is\n                        returned. This Status Code is only returned when a loaded redirect entry is\n                        found and returned. Default successful redirect Status Code is 307\n                        (Temporary Redirect).\n  --field-delimiter FIELD_DELIMITER\n                        Field delimiter string for --redirects files per-line redirect entries.\n                        Default is \"\\t\" (ordinal 9).\n  --status-note-file STATUS_NOTE_FILE\n                        Status page note: Filesystem path to a file with HTML that will be embedded\n                        within a <div> element in the status page.\n  --no-cache            Turn off caching. Caching will store finalized 'To:' Header URLs in process\n                        memory. If users are expected to pass secrets (e.g. a password in a URL\n                        parameter) then turn off caching.\n  --shutdown SHUTDOWN   Shutdown the server after passed seconds. Intended for testing.\n  --log LOG             Log to file at path LOG. Default logging is to sys.stderr.\n  --debug               Set logging level to DEBUG. Default logging level is INFO.\n  --version             Print \"goto_http_redirect_server 1.2.1\" and exit.\n  -?, -h, --help        Print this help message and exit.\n\nAbout Redirect Entries:\n\n  Entries found in --redirects file(s) and entries passed via --from-to are\n  combined.\n  Entries passed via --from-to override any matching \"from path\" entry found in\n  redirects files.\n  The \"from path\" field corresponds to the URI Path in the originating request.\n  The \"to URL\" field corresponds to HTTP Header \"Location\" in the server\n  Redirect reply.\n\n  A redirects file entry has four fields separated by FIELD_DELIMITER character:\n  \"from path\", \"to URL\", \"added by user\", \"added on datetime\".\n  For example,\n\n    /hr http://human-resources.megacorp.local/login     bob     2019-09-07 12:00:00\n\n  The last two fields, \"added by user\" and \"added on datetime\", are intended\n  for record-keeping within an organization.\n\n  A passed redirect should have a leading \"/\" as this is the URI path given for\n  processing.\n  For example, the URL \"http://host/hr\" is processed as URI path \"/hr\".\n\n  A redirect will combine the various incoming URI parts.\n  For example, given redirect entry:\n\n    /b  http://bug-tracker.megacorp.local/view.cgi      bob     2019-09-07 12:00:00\n\n  And incoming GET or HEAD request:\n\n    http://goto/b?id=123\n\n  will result in a redirect URL:\n\n    http://bug-tracker.megacorp.local/view.cgi?id=123\n\nRedirect Entry Template Syntax (\"dynamic\" URLs):\n\n  Special substrings with Python string.Template syntax may be set in the\n  redirect entry \"To\" field.\n\n  First, given the URL\n\n     http://host.com/pa/th;parm?a=A&b=B#frag\n\n  the URI parts that form a urllib.urlparse ParseResult class would be:\n\n    ParseResult(scheme='http', netloc='host.com', path='/pa/th',\n                params='parm', query='a=A&b=B', fragment='frag')\n\n  So then given redirect entry:\n\n    /b  http://bug-tracker.megacorp.local/view.cgi?id=${query}  bob     2019-09-07 12:00:00\n\n  and the incoming GET or HEAD request:\n\n    http://goto/b?123\n\n  Substring '123' is the 'query' part of the ParseResult. The resultant redirect\n  URL would become:\n\n    http://bug-tracker.megacorp.local/view.cgi?id=123\n\nRedirect Entry Required Request Modifiers:\n\n  Ending the Redirect Entry \"from path\" field with various URI separators allows\n  preferences for which Redirect Entry to use. The purpose is to allow\n  preferring a different Redirect Entry depending upon the users request.\n\n  Given redirect entries:\n\n    /b? http://bug-tracker.megacorp.local/view.cgi?id=${query}  bob     2019-09-07 12:00:00\n    /b  http://bug-tracker.megacorp.local/main  bob     2019-09-07 12:00:00\n\n  and the incoming GET or HEAD request:\n\n    http://goto/b?123\n\n  This will choose the first Redirect Entry and return 'Location' header\n\n    http://bug-tracker.megacorp.local/view.cgi?id=123\n\n  Whereas the incoming GET or HEAD request:\n\n    http://goto/b\n\n  This will choose the second Redirect Entry and return 'Location' header\n\n    http://bug-tracker.megacorp.local/main\n\n  The example combination sends a basic request for '/b' to some static page and\n  a particular query request '/b?123' to a particular query path.\n  Failed matches will \"fallback\" to the basic Redirect Entry, e.g. the Entry\n  without any Required Request Modifiers.\n\n  A Redirect Entry with Required Request Modifier will not match a request\n  without such a modifier.\n\n  Given redirect entries:\n\n    /b? http://bug-tracker.megacorp.local/view.cgi?id=${query}  bob     2019-09-07 12:00:00\n\n  and the incoming GET or HEAD request:\n\n    http://goto/b\n\n  will return 404 NOT FOUND.\n\n  Required Request Modifiers must be at the end of the \"from path\" field string.\n  Required Request Modifiers strings are:\n\n     ';'  for user requests with a parameter.\n     '?'  for user requests with a query.\n     ';?' for user requests with a parameter and a query.\n\nAbout Redirect Files:\n\n   A line with a leading \"#\" will be ignored.\n\nAbout Reloads:\n\n  Sending a process signal to the running process will cause\n  a reload of any files passed via --redirects.  This allows live updating of\n  redirect information without disrupting the running server process.\n  On Unix, the signal is SIGUSR1.  On Windows, the signal is SIGBREAK.\n  On this system, the signal is Signals.SIGUSR1 (10).\n  On Unix, use program `kill`.  On Windows, use program `windows-kill.exe`.\n\n  A reload of redirect files may also be requested via passed URL path\n  RELOAD_PATH.\n\nAbout Paths:\n\n  Options --status-path and --reload-path may be passed paths to obscure access\n  from unauthorized users. e.g.\n\n      --status-path '/62aa687a-c75d-47a5-b76f-4e33ea776e4b'\n\nAbout this program:\n\n  Underlying caching is so HTTP Redirect responses are a little bit faster.\n\n  Modules used are available within the standard CPython distribution.\n  Written for Python 3.7 but hacked to run with at least Python 3.6.\n```\n\n----\n\nThis project is released under [an MIT License granted by Dell Incorporated's\nOpen Source Project program](./LICENSE). All project contributions are entirely\nreflective of the respective author(s) and not of Dell Inc.\n\nSome portions of Javascript code in this project are subject to\n[a separate MIT License](https://kryogenix.org/code/browser/licence.html).\n\n----\n\n<a href=\"https://stackexchange.com/users/216253/\"><img src=\"https://stackexchange.com/users/flair/216253.png\" width=\"208\" height=\"58\" alt=\"profile for @JamesThomasMoon on Stack Exchange, a network of free, community-driven Q&amp;A sites\" title=\"profile for @JamesThomasMoon on Stack Exchange, a network of free, community-driven Q&amp;A sites\" /></a>\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "The \"Go To\" HTTP Redirect Server for sharing dynamic shortcut URLs on your network.",
    "version": "1.2.1",
    "split_keywords": [
        "http-server",
        "redirect-urls",
        "shortcuts",
        "shorturl",
        "shorturl-servicesshorturls",
        "url-shortener"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "a1ce9c56b65f78bccd899352d526154a",
                "sha256": "fe467e2002fc0bfc3d08ca7e39f220a52e84068fa9b57c3977e0116f5c8c4dc0"
            },
            "downloads": -1,
            "filename": "goto_http_redirect_server-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a1ce9c56b65f78bccd899352d526154a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 46433,
            "upload_time": "2022-12-31T01:35:20",
            "upload_time_iso_8601": "2022-12-31T01:35:20.498248Z",
            "url": "https://files.pythonhosted.org/packages/b1/52/a95686c294d3d446e8edec5a2dde99ac18e6308569b62927b6c89a0565cd/goto_http_redirect_server-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-31 01:35:20",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "goto-http-redirect-server"
}
        
Elapsed time: 0.05027s