
#-----------------------------------------------------------------------
# MODULE CONFIGURATION
#-----------------------------------------------------------------------
#
#m# 123
#a# accept ports
#i# cluster
#n# transparentproxy
#t# clients
#v# ports 80 443
#
#   |--------------------------------------------------------------------|
#d# Redirect connections to remote http servers from these clients, to a 
#d# local proxy server (squid, etc.). You must also specify the ports
#d# which are to be redirected in the 'ports' option. It is assumed that
#d# a local http proxy is runing ON THE FIRST PORT LISTED in the
#d# ports-{int}-proxy-clients option. Additional ports in this option are
#d# ignored.
#   |--------------------------------------------------------------------|
#
#-----------------------------------------------------------------------
# START OF MODULE CODE
#-----------------------------------------------------------------------

for host in `Option_Value accept $INTOPT transparentproxy clients`
do
	for transparentport in `Option_Value ports $INTOPT transparentproxy clients`
	do
	    for proxyport in `Option_Value ports $INTOPT proxy clients`
	    do
			echo "Accept $INTOPT $IPADDR Transparent Proxy Port# $transparentport <- $host $log_msg"
			ipchains -A $INCHAIN  -j REDIRECT $proxyport -p tcp      -s $host $UNPRIVPORTS   -d 0/0 $transparentport $LOG
			ipchains -A $OUTCHAIN -j ACCEPT              -p tcp ! -y -s 0/0 $transparentport -d $host $UNPRIVPORTS   $LOG
			continue
	    done
	done
done
unset host proxyport transparentport

