Some modifications to use the real user IP behind proxies