Check X-Forwarded-Proto when behind a proxy to see what the protocol is.

Port of Dancer PR #1015.