Skip to main content

Proxy a URL through a Datasette instance

Project description

datasette-proxy-url

PyPI Changelog Tests License

Proxy a URL through a Datasette instance

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-proxy-url

Usage

This plugin can be configured to set specific paths within Datasette to proxy content from another URL.

Configure the plugin like this:

{
    "plugins": {
        "datasette-proxy-url": {
            "paths": [
                {"path": "/proxy", "backend": "http://example.com/"},
            ]
        }
    }
}

Now any request to /proxy will serve the HTML content from http://example.com/.

The content-type response header and the content body will be passed through. All other headers are currently ignored.

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-proxy-url
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datasette-proxy-url-0.1.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

datasette_proxy_url-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file datasette-proxy-url-0.1.1.tar.gz.

File metadata

  • Download URL: datasette-proxy-url-0.1.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for datasette-proxy-url-0.1.1.tar.gz
Algorithm Hash digest
SHA256 017ef6425282562cef4db154e8e8d0c7db1ae030fbc1b40e04884c2d29de33d0
MD5 9a6778e6bd2871db56c0faf0f7c016e5
BLAKE2b-256 3d2e6efa198f7cdab54d4ecefb49f3eac6d478d491d0027f245757282d21a177

See more details on using hashes here.

File details

Details for the file datasette_proxy_url-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for datasette_proxy_url-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cecc4091538975a25d634cb7efc47cd7125f2547d23ec85339aa2eac596ea706
MD5 0195810bc67109320070d6330108067f
BLAKE2b-256 9ab0ecbf45279a5649f51bf41bc8b52463f492b4e822c36cab8097883ae21d0b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page