I assume you have not the latest version of SCP (3.0.0) because I have changed that code precisely to add the ability to avoid proxies (the old method can by bypassed using some tricks). Anyway the code in that page is not the same of that function because one (the old) returns the X-Forwarded header, that is a header using when you use proxies. This way you get the real ip instead the proxy IP. But this method to determine the IP is dangerous, so I changed it. The new method only relies in the IP returned by the other header, that can't be spoofed.