X-Forwarded-For based server selection with -H option

From: Kozman Bálint <kozman.balint_at_ardinsys.hu>
Date: Tue, 18 Sep 2007 12:50:24 +0200

Hello,

I experienced that if pen is sitting behind a proxy (eg. an apache
mod_proxy), then it is able to forward the X-Forwarded-For header on,
but will still use the tcp client address in the server selection
function. Which, if I'm not mistaken, is always the address of the proxy
server, and that means that there will be no real load balancing
performed (or at least not too fair).

Attached is a patch, that intends to work around this issue. It will
change the add_client function so that pen uses a prefetch buffer to get
the value of the X-Forwarded-For header, and then use that for server
selection. If it fails reading the header value, it will use the tcp
client address instead.

The patch can be applied against pen.c, v0.17.2.

Regards,
Balint

Received on Tue Sep 18 2007 - 12:53:31 CEST

This archive was generated by hypermail 2.2.0 : Tue Sep 18 2007 - 12:53:33 CEST