Cloudflare proxy support for flask application
Project description
Cloudflare proxy support for flask application.
It gets client ip from cloudflare headers and can allow request from cloudflare ips only.
Quickstart
Install flask_cloudflare_remote using pip:
$ pip install Flask-CloudflareRemote
Example usage
import flask
from flask_cloudflare_remote import CloudflareRemote
app = Flask(__name__)
cf = CloudflareRemote()
cf.init_app(app)
Configuration
CF_DOMAIN: (default: ‘www.cloudflare.com’)
CF_REQ_TIMEOUT: (default: 10)
CF_IPs: (default: None) list of allowed cloudflare ips
CF_IP4_URI: (default: ‘/ips-v4’) ipv4 list uri
CF_IP6_URI: (default: ‘/ips-v6’) ipv6 list uri
CF_IPv6_ENABLED: (default: False) enable ipv6
CF_STRICT_ACCESS: (default: True) return forbidden if remote ip is not in allowed list
CF_OVERRIDE_REMOTE: (default: True) override flask REMOTE_ADDR from request
CF_HDR_CLIENT_IP: (default: ‘CF-Connecting-IP’) header key used for client ip
License MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Flask-CloudflareRemote-1.0.0b0.tar.gz
.
File metadata
- Download URL: Flask-CloudflareRemote-1.0.0b0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23cb2e9924a658deeaf4b79f75b338a961ae27f98d8abdd532271c806c6d47f5 |
|
MD5 | 2774a38bfd6dda4ebf48b07ad51e907a |
|
BLAKE2b-256 | e885a3b57edacbbff37ebb7b4ea636e9979c6e0830bbde359929a8b95ad439f1 |