diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2006-12-22 16:35:25 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2006-12-22 16:35:25 +0000 |
commit | b64ef7e3577003b74ea29ecb40fc36220508f8a5 (patch) | |
tree | c98a20c805242a1fc4bce99ae9fb4bf2c0956495 /packages | |
parent | 7fb1032da3a888d8bfc0f6044518be020d34f9f0 (diff) | |
download | pfsense-packages-b64ef7e3577003b74ea29ecb40fc36220508f8a5.tar.gz pfsense-packages-b64ef7e3577003b74ea29ecb40fc36220508f8a5.tar.bz2 pfsense-packages-b64ef7e3577003b74ea29ecb40fc36220508f8a5.zip |
More fixes by Umberto from the forum.
We can now run transparent proxy eventhough the webgui uses the same.
http://forum.pfsense.org/index.php/topic,3089.msg18804.html#msg18804
Diffstat (limited to 'packages')
-rw-r--r-- | packages/squid/squid.inc | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/packages/squid/squid.inc b/packages/squid/squid.inc index adb55630..fc705d52 100644 --- a/packages/squid/squid.inc +++ b/packages/squid/squid.inc @@ -210,18 +210,12 @@ function squid_validate_general($post, $input_errors) { if (strlen($post['log_dir']) <= 3) $input_errors[] = "That is not a valid log location dir"; - if (($post['transparent_proxy'] == 'on')) { - $port = 80; - } else { - $port = trim($post['proxy_port']); - } - $webgui_port = $config['system']['webgui']['port']; if(($config['system']['webgui']['port'] == "") && ($config['system']['webgui']['protocol'] == "http")) { $webgui_port = 80; } - if ($port == $webgui_port) { + if (($post['transparent_proxy'] != 'on') && ($port == $webgui_port)) { $input_errors[] = "You can not run squid on the same port as the webgui"; } } @@ -382,12 +376,12 @@ function squid_resync_general() { $real_ifaces = array(); foreach (explode(',', $ifaces) as $i => $iface) { $real_ifaces[] = squid_get_real_interface_address($iface); - if($real_ifaces[$i][0]) - $conf .= "http_port {$real_ifaces[$i][0]}"; + if($real_ifaces[$i][0]) { if (($settings['transparent_proxy'] == 'on')) { - $conf .= ":80 transparent\n"; + $conf .= "http_port 127.0.0.1:80 transparent\n"; } else { - $conf .= ":$port\n"; + $conf .= "http_port {$real_ifaces[$i][0]}:$port\n"; + } } } @@ -912,7 +906,7 @@ function squid_generate_rules($type) { case 'nat': foreach ($ifaces as $iface) $rules .= "# Setup Squid transparent proxy redirect\n"; - $rules .= "rdr on $iface proto tcp from any to !($iface) port 80 -> ($iface) port 80\n"; + $rules .= "rdr on $iface proto tcp from any to !($iface) port 80 -> 127.0.0.1 port 80\n"; $rules .= "\n"; break; case 'filter': |