#5807 enhancement new
something in twisted.web should respect (x-)forwarded-for on the server side
|Reported by:||Glyph||Owned by:||Mike Handverger|
branch-diff, diff-cov, branch-cov, buildbot
Description (last modified by )
This should work vaguely the same way that
Request.getHost()should return the forwarded-for host rather than the
Request.isSecureshould return the security of the proto parameter
VHostMonster, there should be some configuration required to get into this mode. One mechanism for doing that would be to have a
ForwardedForParserResource; however, since the connecting address is quite important, it may also be reasonable to build this directly into
Site. Trusting random forwarded-for headers off the internet would not be good, so it should be easy to specify what the address of the expected terminating proxy is.
Also, forwarded-for is a bit more expressive than the vhostmonster idiom in that it can describe multiple hops. This additional information should be exposed through an explicit API - perhaps a new
forwardedFor method on Resource that returns an iterable of objects describing the hosts that it was forwarded through.