i need the real IP and PORT of the User:
so i use → $_SERVER[“HTTP_CF_CONNECTING_IP”] instead of $_SERVER[REMOTE_ADDR] and it works like a charm for the IP.
BUT, i can’t find the equivalent to $_SERVER[REMOTE_PORT]
How i get the real Port of the user?
You can use Transform Rules to add a header (e.g.
X-Client-Port) containing the real client port.
Hey Albert, thank you very much for your effort and quick reply
But unfortunately i doesn’t work
When i using “echo $_SERVER[“X-Client-Port”]:” its empty.
You have an Idea?
So I personally haven’t used PHP but I believe you need to use
Also, just use
true as the expression. That will make sure it always runs.
hey, yes that’s true now it works. thank you very much
ps: if anybody is looking for other variables… just print_r (print_r ($_SERVER)) on the whole $_SERVER array and yo get a nice list of all available “options”.
PS: if you want to verify that the given port is correct → u can use this handy commandline tool:
sudo tcptrack -i
in my case: in every single request Cloudflare had given back the right / real user port
and keep in mind: port can change every single request… so i might look like a random number
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.