Fix for x-forwarded-for header
Create getRemoteAddress function to consistently detect client ip address