X-Forwarded-For header support
Add X-Forwarded-Proto line to response
Reset sent_xff flag upon response from server

HTTP Keep Alive support means more than one
request can go over a single connection. Make
sure to send the X-Forwarded-For and X-Forwarded-Proto
headers for each one, and not just the first.