Skip to content

Commit 8d7dfa4

Browse files
bartesMaria Korlotian
andauthored
updated ip_headers suggestions (#75)
Co-authored-by: Maria Korlotian <[email protected]>
1 parent 0bd9f99 commit 8d7dfa4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ import and configure the library with your Castle API secret.
4949
# We try to fetch the client IP based on X-Forwarded-For or Remote-Addr headers in that order,
5050
# but sometimes the client IP may be stored in a different header or order.
5151
# The SDK can be configured to look for the client IP address in headers that you specify.
52+
53+
# Sometimes, Cloud providers do not use consistent IP addresses to proxy requests.
54+
# In this case, the client IP is usually preserved in a custom header. Example:
55+
# Cloudflare preserves the client request in the 'Cf-Connecting-Ip' header.
56+
# It would be used like so: configuration.ip_headers=['Cf-Connecting-Ip']
57+
configuration.ip_headers = []
58+
5259
# If the specified header or X-Forwarded-For default contains a proxy chain with public IP addresses,
5360
# then one of the following must be set
5461
# 1. The trusted_proxies value must match the known proxy IP's
5562
# 2. The trusted_proxy_depth value must be set to the number of known trusted proxies in the chain (see below)
56-
configuration.ip_headers = []
5763
5864
# Additionally to make X-Forwarded-For and other headers work better discovering client ip address,
5965
# and not the address of a reverse proxy server, you can define trusted proxies

0 commit comments

Comments
 (0)