I got a weird bug, in which request.client_addr was reported as
192.168.76.75:52411, which broke a function which expected it to be a standard IP address. In the documentation I've read that this could be anything, so I guess this isn't a surprise.
I am using CloudFlare -> nginx -> gunicorn -> pyramid setup. These were the headers of that request:
Cf-Connecting-Ip 67.133.63.210
My question is that since I'm using CloudFlare and I know that Cf-Connecting-Ip is a reliable, trustable source of IP address, unlike X-Forwarded-For. How should I modify my request.client_addr to use this value whenever it is present?
Zsolt