<tag>logfile_daemon</tag>
<p>Ported from 2.7
+ <tag>tproxy_uses_indirect_client</tag>
+ <p>Controls whether the indirect client address found in the X-Forwarded-For
+ header is used for spoofing instead of the directly connected client address.
+ Requires both --enable-follow-x-forwarded-for and --enable-linux-netfilter
+
</descrip>
<sect1>Changes to existing tags<label id="modifiedtags">
refer to as the indirect client address. This address may
be treated as the client address for access control, ICAP, delay
pools and logging, depending on the acl_uses_indirect_client,
- icap_uses_indirect_client, delay_pool_uses_indirect_client and
- log_uses_indirect_client options.
+ icap_uses_indirect_client, delay_pool_uses_indirect_client,
+ log_uses_indirect_client and tproxy_uses_indirect_client options.
This clause only supports fast acl types.
See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details.
direct client address in the access log.
DOC_END
+NAME: tproxy_uses_indirect_client
+COMMENT: on|off
+TYPE: onoff
+IFDEF: FOLLOW_X_FORWARDED_FOR&&LINUX_NETFILTER
+DEFAULT: on
+LOC: Config.onoff.tproxy_uses_indirect_client
+DOC_START
+ Controls whether the indirect client address
+ (see follow_x_forwarded_for) is used instead of the
+ direct client address when spoofing the outgoing client.
+DOC_END
+
NAME: http_access
TYPE: acl_access
LOC: Config.accessList.http
define["FOLLOW_X_FORWARDED_FOR"]="--enable-follow-x-forwarded-for"
define["FOLLOW_X_FORWARDED_FOR&&DELAY_POOLS"]="--enable-follow-x-forwarded-for and --enable-delay-pools"
define["FOLLOW_X_FORWARDED_FOR&&ICAP_CLIENT"]="--enable-follow-x-forwarded-for and --enable-icap-client"
+ define["FOLLOW_X_FORWARDED_FOR&&LINUX_NETFILTER"]="--enable-follow-x-forwarded-for and --enable-linux-netfilter"
define["HTTP_VIOLATIONS"]="--enable-http-violations"
define["ICAP_CLIENT"]="--enable-icap-client"
define["SQUID_SNMP"]="--enable-snmp"
getOutgoingAddr(HttpRequest * request, struct peer *dst_peer)
{
if (request && request->flags.spoof_client_ip) {
- if (!dst_peer || !dst_peer->options.no_tproxy)
- return request->client_addr;
+ if (!dst_peer || !dst_peer->options.no_tproxy) {
+#if FOLLOW_X_FORWARDED_FOR && LINUX_NETFILTER
+ if (Config.onoff.tproxy_uses_indirect_client)
+ return request->indirect_client_addr;
+ else
+#endif
+ return request->client_addr;
+ }
// else no tproxy today ...
}
int acl_uses_indirect_client;
int delay_pool_uses_indirect_client;
int log_uses_indirect_client;
+#if LINUX_NETFILTER
+ int tproxy_uses_indirect_client;
+#endif
#endif /* FOLLOW_X_FORWARDED_FOR */
int WIN32_IpAddrChangeMonitor;