Use getMyPort() to insert the forward-proxy listening port into error
pages and deny_info redirect URLs. This fixes the current port
hard-coding assumption in ERR_AGENT_CONFIGURE.
The %b option is added for this purpose as a temporary measure until the
codes are merged with the more flexible log formatting set.
This depends on the getMyPort() alteration presented earlier for its
accuracy. It may be used separately, but squid.conf then must have a
particular http_port ordering with the forward-proxy port listed first.
Amos
--
Please be using
Current Stable Squid 2.7.STABLE9 or 3.1.12
Beta testers wanted for 3.2.0.6
=== modified file 'errors/templates/ERR_AGENT_CONFIGURE'
--- errors/templates/ERR_AGENT_CONFIGURE 2010-03-16 23:53:33 +0000
+++ errors/templates/ERR_AGENT_CONFIGURE 2011-04-10 07:34:53 +0000
@@ -27,7 +27,7 @@
For Firefox browsers go to:
<ul>
<li>Tools -> Options -> Advanced -> Network -> Connection Settings</li>
-<li>In the HTTP proxy box type the proxy name %h and port 3128.</li>
+<li>In the HTTP proxy box type the proxy name %h and port %b.</li>
</ul>
</div>
@@ -35,7 +35,7 @@
For Internet Explorer browsers go to:
<ul>
<li>Tools -> Internet Options -> Connection -> LAN Settings ->Proxy</li>
-<li>In the HTTP proxy box type the proxy name %h and port 3128.</li>
+<li>In the HTTP proxy box type the proxy name %h and port %b.</li>
</ul>
</div>
@@ -43,7 +43,7 @@
For Opera browsers go to:
<ul>
<li>Tools -> Preferences -> Advanced -> Network -> Proxy Servers</li>
-<li>In the HTTP proxy box type the proxy name %h and port 3128.</li>
+<li>In the HTTP proxy box type the proxy name %h and port %b.</li>
</ul>
</div>
=== modified file 'src/errorpage.cc'
--- src/errorpage.cc 2011-03-16 09:29:40 +0000
+++ src/errorpage.cc 2011-04-10 07:33:40 +0000
@@ -670,6 +670,11 @@
#endif
p = "-";
break;
+
+ case 'b':
+ mb.Printf("%d", getMyPort());
+ break;
+
case 'B':
if (building_deny_info_url) break;
p = request ? ftpUrlWith2f(request) : "[no URL]";