Skip to main content

A python implementation of configurable-http-proxy

Project description

configurable-http-proxy

This is a pure python implementation of the configurable-http-proxy written in nodejs. It is meant to be a drop in replacement.

Install

Prerequisite: Python 3.6+

pip install configurable-http-proxy

Feature support

The following items are supported:

  • Proxying for Websocket and HTTP requests
  • Configuring the proxy using API requests
  • Auth token for API requests
  • Error management using error_path and error_target
  • Prepend path or include prefix
  • Timeouts
  • X-Forward related headers
  • Custom Headers
  • Customizable storage backends
  • PID file writing
  • Logging
  • Configurable storage backend

The following options are additional (not available in nodejs CHP currently):

  • Ready to use DBMS storage backend

The following options are not supported (yet):

  • SSL for proxy, client, API is not available (--ssl-*, --api-ssl-*, --client-ssl-*, --insecure)
  • Redirecting: --redirect-port and --redirect-to
  • Change Origin: --change-origin
  • Rewrites in Location header: --protocol-rewrite and --auto-rewrite
  • Metrics server: --metrics-port and --metrics-ip

Database-backed storage backend

Using a SQL DBMS instead of the default in-memory store enables chp to be replicated in a High Availability scenario.

To use a SQL DBMS as the storage backend:

  1. Install DBMS support
$ pip install configurable-http-proxy[sqla]
  1. Set the CHP_DATABASE_URL env var to any db URL supported by SQLAlchemy. The default is sqlite:///chp.sqlite.
$ export CHP_DATABASE_URL="sqlite:///chp.sqlite"
$ configurable-http-proxy --storage-backend configurable_http_proxy.dbstore.DatabaseStore
  1. Optionally you may set the table name by setting the CHP_DATABASE_TABLE. The default is 'chp_routes'
$ export CHP_DATABASE_TABLE="chp_routes"

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

configurable_http_proxy-0.4.0.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

configurable_http_proxy-0.4.0-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file configurable_http_proxy-0.4.0.tar.gz.

File metadata

  • Download URL: configurable_http_proxy-0.4.0.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for configurable_http_proxy-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2823b5a0d980b3128c93cca22b20f575e591e46dc234c0c36d44062b15beb332
MD5 8802ba4f87fec11dea6d45dbf89a3110
BLAKE2b-256 a600b41492e1bb64dcc71ac2b35e54d35a72c348979517fa82bc1db6902dcfa7

See more details on using hashes here.

File details

Details for the file configurable_http_proxy-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for configurable_http_proxy-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9c83a7d5a07df5b698b030a35b4a799986197ba5ad15869a7f368a3cd6cd643
MD5 fff2818d3aeb576884a8034e4ab460d8
BLAKE2b-256 7a645508c5322b342a19fcf650b9e666cc97de2a436b7ca66f4ed6544b43fe1d

See more details on using hashes here.

Supported by

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