=== added file 'errors/templates/ERR_AGENT_PACFILE' --- errors/templates/ERR_AGENT_PACFILE 1970-01-01 00:00:00 +0000 +++ errors/templates/ERR_AGENT_PACFILE 2010-06-29 03:44:45 +0000 @@ -0,0 +1,59 @@ + + + +Web Browser Configuration + + +
+

ERROR

+

Web Browser Configuration

+
+
+ +
+
+

Your Web Browser configuration needs to be corrected to use this network.

+
+ +

How to find these settings in your browser:

+ +
+For Firefox browsers go to: + +
+ +
+For Internet Explorer browsers go to: + +
+ +
+For Opera browsers go to: + +
+ +

Your cache administrator is %w.

+
+
+ +
+ + === added file 'errors/templates/ERR_BLANK' === modified file 'src/cache_cf.cc' --- src/cache_cf.cc 2010-06-03 00:12:32 +0000 +++ src/cache_cf.cc 2010-06-29 02:23:11 +0000 @@ -498,6 +498,11 @@ if (Config.errHtmlText == NULL) Config.errHtmlText = xstrdup(null_string); + if (Config.pac_file != NULL) { + requirePathnameExists("pac_file", Config.pac_file); + Config.pac_file_id = errorReservePageId(Config.pac_file); + } + storeConfigure(); snprintf(ThisCache, sizeof(ThisCache), "%s (%s)", === modified file 'src/cf.data.pre' --- src/cf.data.pre 2010-06-26 01:18:17 +0000 +++ src/cf.data.pre 2010-06-29 03:41:52 +0000 @@ -4412,6 +4452,26 @@ your value with 0. DOC_END +NAME: pac_file +TYPE: string +LOC: Config.pac_file +DEFAULT: none +DOC_START + Specifies the location of a Proxy Auto-Configuration (PAC) file. + + Combined with the visible_hostname directive Squid will respond with + this file when client browsers request the URL: + http://${visible_hostname}/wpad.dat + + WPAD (Web Proxy Auto-Detection) systems need to be configured with the + above URL for retrieving the PAC containing proxy selection logics. + + To disable, remove from the configuration. + + Example; + pac_file @DEFAULT_CONFIG_DIR@/proxy.pac +DOC_END + COMMENT_START OPTIONS FOR THE CACHE REGISTRATION SERVICE ----------------------------------------------------------------------------- === modified file 'src/err_type.h' --- src/err_type.h 2009-10-31 11:53:09 +0000 +++ src/err_type.h 2010-06-29 03:29:38 +0000 @@ -55,6 +55,7 @@ ERR_DIR_LISTING, /* Display of remote directory (FTP, Gopher) */ ERR_SQUID_SIGNATURE, /* not really an error */ ERR_SHUTTING_DOWN, + ERR_BLANK, TCP_RESET, ERR_MAX === modified file 'src/forward.cc' --- src/forward.cc 2010-06-03 07:49:20 +0000 +++ src/forward.cc 2010-06-29 03:42:39 +0000 @@ -196,6 +196,26 @@ FwdState::fwdStart(int client_fd, StoreEntry *entry, HttpRequest *request) { /** \note + * Forwarding requests to our own unique machine name indicates it maybe an internal request. ?? + */ + if (internalHostnameIs(request->GetHost())) { + // if PATH is /wpad.dat - send the pac_file or a 404 error. + if (request->urlpath.caseCmp("/wpad.dat")) == 0) { + ErrorState *anErr; + if (Config.pac_file) { + // send proxy.pac file + anErr = errorCon(Config.pac_file_id, HTTP_OK, request); + } else { + // Send 404 error with no page (PAC not configured locally) + anErr = errorCon(ERR_BLANK, HTTP_NOT_FOUND, request); + } + errorAppendEntry(entry, anErr); // frees anErr + entry->getReply()->content_type = "application/x-ns-proxy-autoconfig"; + return; + } + } + + /** \note * client_addr == no_addr indicates this is an "internal" request * from peer_digest.c, asn.c, netdb.c, etc and should always * be allowed. yuck, I know. === modified file 'src/structs.h' --- src/structs.h 2010-06-11 05:24:52 +0000 +++ src/structs.h 2010-06-29 02:24:07 +0000 @@ -519,6 +522,8 @@ int errorLogMissingLanguages; #endif char *errorStylesheet; + char *pac_file; + err_type pac_file_id; struct { int maxtries;