handle X-Forwarded-Proto/X-Forwarded-Port

improve handling when running behind a proxy/load-balancer by
interpreting X-Forwarded-Proto and X-Forwarded-Port headers; should
close #8