diff -Nru privoxy-3.0.17/acconfig.h privoxy-3.0.19/acconfig.h --- privoxy-3.0.17/acconfig.h 2009-12-16 08:35:13.000000000 +0000 +++ privoxy-3.0.19/acconfig.h 2011-09-04 11:10:32.000000000 +0000 @@ -5,7 +5,7 @@ * File : $Source: /cvsroot/ijbswa/current/acconfig.h,v $ * * Purpose : This file should be the first thing included in every - * .c file. (Before even system headers). It contains + * .c file. (Before even system headers). It contains * #define statements for various features. It was * introduced because the compile command line started * getting ludicrously long with feature defines. @@ -14,10 +14,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -64,7 +64,7 @@ */ #undef CODE_STATUS -/* +/* * Should pcre be statically built in instead of linkling with libpcre? * (This is determined by configure depending on the availiability of * libpcre and user preferences). The name is ugly, but pcre needs it. @@ -72,7 +72,7 @@ */ #undef STATIC_PCRE -/* +/* * Should pcrs be statically built in instead of linkling with libpcrs? * (This is determined by configure depending on the availiability of * libpcrs and user preferences). @@ -136,14 +136,14 @@ * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) * Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / * * - * And no, I haven't got that backwards - IE is being wierd. + * And no, I haven't got that backwards - IE is being weird. * - * Known limitations: + * Known limitations: * 1) If you press shift-reload on a blocked HTML page, you get * the image "blocked" page, not the HTML "blocked" page. - * 2) Once an image "blocked" page has been sent, viewing it + * 2) Once an image "blocked" page has been sent, viewing it * in it's own browser window *should* bring up the HTML - * "blocked" page, but it doesn't. You need to clear the + * "blocked" page, but it doesn't. You need to clear the * browser cache to get the HTML version again. * * These limitations are due to IE making inconsistent choices @@ -237,7 +237,7 @@ #undef HAVE_GMTIME_R #undef HAVE_LOCALTIME_R -/* Define to 'int' if doesn't have it. +/* Define to 'int' if doesn't have it. */ #undef socklen_t @@ -287,7 +287,7 @@ /* * It's too easy to accidentally use a Cygwin or MinGW32 version of config.h - * under VC++, and it usually gives many wierd error messages. Let's make + * under VC++, and it usually gives many weird error messages. Let's make * the error messages understandable, by bailing out now. */ #ifdef _MSC_VER diff -Nru privoxy-3.0.17/actionlist.h privoxy-3.0.19/actionlist.h --- privoxy-3.0.17/actionlist.h 2009-06-21 19:21:10.000000000 +0000 +++ privoxy-3.0.19/actionlist.h 2011-11-06 11:38:51.000000000 +0000 @@ -12,14 +12,14 @@ * DEFINE_ACTION_BOOL() * DEFINE_ACTION_ALIAS * - * Copyright : Written by and Copyright (C) 2001-2008 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2008 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -71,9 +71,11 @@ DEFINE_CGI_PARAM_RADIO ("deanimate-gifs", ACTION_DEANIMATE, ACTION_STRING_DEANIMATE, "first", 0) DEFINE_CGI_PARAM_RADIO ("deanimate-gifs", ACTION_DEANIMATE, ACTION_STRING_DEANIMATE, "last", 1) DEFINE_ACTION_BOOL ("downgrade-http-version", ACTION_DOWNGRADE) +#ifdef FEATURE_FAST_REDIRECTS DEFINE_ACTION_STRING ("fast-redirects", ACTION_FAST_REDIRECTS, ACTION_STRING_FAST_REDIRECTS) DEFINE_CGI_PARAM_RADIO ("fast-redirects", ACTION_FAST_REDIRECTS, ACTION_STRING_FAST_REDIRECTS, "simple-check", 0) DEFINE_CGI_PARAM_RADIO ("fast-redirects", ACTION_FAST_REDIRECTS, ACTION_STRING_FAST_REDIRECTS, "check-decoded-url", 1) +#endif /* def FEATURE_FAST_REDIRECTS */ DEFINE_ACTION_MULTI ("filter", ACTION_MULTI_FILTER) DEFINE_ACTION_BOOL ("force-text-mode", ACTION_FORCE_TEXT_MODE) DEFINE_ACTION_STRING ("forward-override", ACTION_FORWARD_OVERRIDE, ACTION_STRING_FORWARD_OVERRIDE) @@ -119,19 +121,19 @@ #if DEFINE_ACTION_ALIAS -/* +/* * Alternative spellings */ DEFINE_ACTION_STRING ("hide-referer", ACTION_HIDE_REFERER, ACTION_STRING_REFERER) DEFINE_ACTION_BOOL ("prevent-keeping-cookies", ACTION_NO_COOKIE_KEEP) -/* +/* * Pre-3.0.7 (pseudo) compatibility */ DEFINE_ACTION_MULTI ("filter-client-headers", ACTION_MULTI_CLIENT_HEADER_FILTER) DEFINE_ACTION_MULTI ("filter-server-headers", ACTION_MULTI_SERVER_HEADER_FILTER) -/* +/* * Pre-3.0 compatibility */ DEFINE_ACTION_BOOL ("no-cookie-read", ACTION_NO_COOKIE_READ) diff -Nru privoxy-3.0.17/actions.c privoxy-3.0.19/actions.c --- privoxy-3.0.17/actions.c 2010-05-30 12:02:59.000000000 +0000 +++ privoxy-3.0.19/actions.c 2011-09-18 14:43:07.000000000 +0000 @@ -1,4 +1,4 @@ -const char actions_rcs[] = "$Id: actions.c,v 1.59 2010/05/26 23:01:47 ler762 Exp $"; +const char actions_rcs[] = "$Id: actions.c,v 1.73 2011/09/18 14:43:07 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/actions.c,v $ @@ -6,7 +6,7 @@ * Purpose : Declares functions to work with actions files * Functions declared include: FIXME * - * Copyright : Written by and Copyright (C) 2001-2008 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -434,7 +434,7 @@ *********************************************************************/ static int action_used_to_be_valid(const char *action) { - static const char *formerly_valid_actions[] = { + static const char * const formerly_valid_actions[] = { "inspect-jpegs", "kill-popups", "send-vanilla-wafer", @@ -522,7 +522,7 @@ if ((value == NULL) || (*value == '\0')) { - if (0 != strcmpic(action->name, "block")) + if (0 == strcmpic(action->name, "+block")) { /* * XXX: Temporary backwards compatibility hack. @@ -1033,6 +1033,108 @@ return 0; } + +/********************************************************************* + * + * Function : referenced_filters_are_missing + * + * Description : Checks if any filters of a certain type referenced + * in an action spec are missing. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : cur_action = The action spec to check. + * 3 : multi_index = The index where to look for the filter. + * 4 : filter_type = The filter type the caller is interested in. + * + * Returns : 0 => All referenced filters exists, everything else is an error. + * + *********************************************************************/ +static int referenced_filters_are_missing(const struct client_state *csp, + const struct action_spec *cur_action, int multi_index, enum filter_type filter_type) +{ + int i; + struct file_list *fl; + struct re_filterfile_spec *b; + struct list_entry *filtername; + + for (filtername = cur_action->multi_add[multi_index]->first; + filtername; filtername = filtername->next) + { + int filter_found = 0; + for (i = 0; i < MAX_AF_FILES; i++) + { + fl = csp->rlist[i]; + if ((NULL == fl) || (NULL == fl->f)) + { + continue; + } + + for (b = fl->f; b; b = b->next) + { + if (b->type != filter_type) + { + continue; + } + if (strcmp(b->name, filtername->str) == 0) + { + filter_found = 1; + } + } + } + if (!filter_found) + { + log_error(LOG_LEVEL_ERROR, "Missing filter '%s'", filtername->str); + return 1; + } + } + + return 0; + +} + + +/********************************************************************* + * + * Function : action_spec_is_valid + * + * Description : Should eventually figure out if an action spec + * is valid, but currently only checks that the + * referenced filters are accounted for. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : cur_action = The action spec to check. + * + * Returns : 0 => No problems detected, everything else is an error. + * + *********************************************************************/ +static int action_spec_is_valid(struct client_state *csp, const struct action_spec *cur_action) +{ + struct { + int multi_index; + enum filter_type filter_type; + } filter_map[] = { + {ACTION_MULTI_FILTER, FT_CONTENT_FILTER}, + {ACTION_MULTI_CLIENT_HEADER_FILTER, FT_CLIENT_HEADER_FILTER}, + {ACTION_MULTI_SERVER_HEADER_FILTER, FT_SERVER_HEADER_FILTER}, + {ACTION_MULTI_CLIENT_HEADER_TAGGER, FT_CLIENT_HEADER_TAGGER}, + {ACTION_MULTI_SERVER_HEADER_TAGGER, FT_SERVER_HEADER_TAGGER} + }; + int errors = 0; + int i; + + for (i = 0; i < SZ(filter_map); i++) + { + errors += referenced_filters_are_missing(csp, cur_action, + filter_map[i].multi_index, filter_map[i].filter_type); + } + + return errors; + +} + + /********************************************************************* * * Function : load_one_actions_file @@ -1055,23 +1157,24 @@ * Note: Keep these in the order they occur in the file, they are * sometimes tested with <= */ -#define MODE_START_OF_FILE 1 -#define MODE_SETTINGS 2 -#define MODE_DESCRIPTION 3 -#define MODE_ALIAS 4 -#define MODE_ACTIONS 5 - - int mode = MODE_START_OF_FILE; + enum { + MODE_START_OF_FILE = 1, + MODE_SETTINGS = 2, + MODE_DESCRIPTION = 3, + MODE_ALIAS = 4, + MODE_ACTIONS = 5 + } mode; FILE *fp; struct url_actions *last_perm; struct url_actions *perm; - char buf[BUFFER_SIZE]; + char *buf; struct file_list *fs; struct action_spec * cur_action = NULL; int cur_action_used = 0; struct action_alias * alias_list = NULL; unsigned long linenum = 0; + mode = MODE_START_OF_FILE; if (!check_file_changed(current_actions_file[fileid], csp->config->actions_file[fileid], &fs)) { @@ -1104,7 +1207,7 @@ log_error(LOG_LEVEL_INFO, "Loading actions file: %s", csp->config->actions_file[fileid]); - while (read_config_line(buf, sizeof(buf), fp, &linenum) != NULL) + while (read_config_line(fp, &linenum, &buf) != NULL) { if (*buf == '{') { @@ -1120,7 +1223,7 @@ /* too short */ fclose(fp); log_error(LOG_LEVEL_FATAL, - "can't load actions file '%s': invalid line (%lu): %s", + "can't load actions file '%s': invalid line (%lu): %s", csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } @@ -1221,11 +1324,11 @@ { /* It's an actions block */ - char actions_buf[BUFFER_SIZE]; + char *actions_buf; char * end; /* set mode */ - mode = MODE_ACTIONS; + mode = MODE_ACTIONS; /* free old action */ if (cur_action) @@ -1248,8 +1351,23 @@ } init_action(cur_action); - /* trim { */ - strlcpy(actions_buf, buf + 1, sizeof(actions_buf)); + /* + * Copy the buffer before messing with it as we may need the + * unmodified version in for the fatal error messages. Given + * that this is not a common event, we could instead simply + * read the line again. + * + * buf + 1 to skip the leading '{' + */ + actions_buf = strdup(buf + 1); + if (actions_buf == NULL) + { + fclose(fp); + log_error(LOG_LEVEL_FATAL, + "can't load actions file '%s': out of memory", + csp->config->actions_file[fileid]); + return 1; /* never get here */ + } /* check we have a trailing } and then trim it */ end = actions_buf + strlen(actions_buf) - 1; @@ -1257,8 +1375,9 @@ { /* No closing } */ fclose(fp); - log_error(LOG_LEVEL_FATAL, - "can't load actions file '%s': invalid line (%lu): %s", + freez(actions_buf); + log_error(LOG_LEVEL_FATAL, "can't load actions file '%s': " + "Missing trailing '}' in action section starting at line (%lu): %s", csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } @@ -1271,11 +1390,21 @@ { /* error */ fclose(fp); - log_error(LOG_LEVEL_FATAL, - "can't load actions file '%s': invalid line (%lu): %s", + freez(actions_buf); + log_error(LOG_LEVEL_FATAL, "can't load actions file '%s': " + "can't completely parse the action section starting at line (%lu): %s", csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } + + if (action_spec_is_valid(csp, cur_action)) + { + log_error(LOG_LEVEL_ERROR, "Invalid action section in file '%s', " + "starting at line %lu: %s", + csp->config->actions_file[fileid], linenum, buf); + } + + freez(actions_buf); } } else if (mode == MODE_SETTINGS) @@ -1299,8 +1428,8 @@ csp->config->actions_file[fileid]); return 1; /* never get here */ } - - num_fields = ssplit(version_string, ".", fields, 3, TRUE, FALSE); + + num_fields = ssplit(version_string, ".", fields, SZ(fields), TRUE, FALSE); if (num_fields < 1 || atoi(fields[0]) == 0) { @@ -1409,7 +1538,7 @@ } else if (mode == MODE_ACTIONS) { - /* it's a URL pattern */ + /* it's an URL pattern */ /* allocate a new node */ if ((perm = zalloc(sizeof(*perm))) == NULL) @@ -1429,7 +1558,7 @@ { fclose(fp); log_error(LOG_LEVEL_FATAL, - "can't load actions file '%s': line %lu: cannot create URL pattern from: %s", + "can't load actions file '%s': line %lu: cannot create URL or TAG pattern from: %s", csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } @@ -1443,7 +1572,7 @@ /* oops - please have a {} line as 1st line in file. */ fclose(fp); log_error(LOG_LEVEL_FATAL, - "can't load actions file '%s': first needed line (%lu) is invalid: %s", + "can't load actions file '%s': line %lu should begin with a '{': %s", csp->config->actions_file[fileid], linenum, buf); return 1; /* never get here */ } @@ -1456,6 +1585,7 @@ csp->config->actions_file[fileid], mode); return 1; /* never get here */ } + freez(buf); } fclose(fp); @@ -1489,7 +1619,7 @@ * * Description : Converts a actionsfile entry from the internal * structure into a text line. The output is split - * into one line for each action with line continuation. + * into one line for each action with line continuation. * * Parameters : * 1 : action = The action to format. @@ -1574,7 +1704,7 @@ * Function : actions_to_html * * Description : Converts a actionsfile entry from numeric form - * ("mask" and "add") to a
-seperated HTML string + * ("mask" and "add") to a
-separated HTML string * in which each action is linked to its chapter in * the user manual. * @@ -1680,12 +1810,12 @@ * * Function : current_actions_to_html * - * Description : Converts a curren action spec to a
seperated HTML + * Description : Converts a curren action spec to a
separated HTML * text in which each action is linked to its chapter in * the user manual. * * Parameters : - * 1 : csp = Client state (for config) + * 1 : csp = Client state (for config) * 2 : action = Current action spec to be converted * * Returns : A string. Caller must free it. diff -Nru privoxy-3.0.17/actions.h privoxy-3.0.19/actions.h --- privoxy-3.0.17/actions.h 2009-06-21 19:21:10.000000000 +0000 +++ privoxy-3.0.19/actions.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef ACTIONS_H_INCLUDED #define ACTIONS_H_INCLUDED -#define ACTIONS_H_VERSION "$Id: actions.h,v 1.19 2009/05/16 13:27:20 fabiankeil Exp $" +#define ACTIONS_H_VERSION "$Id: actions.h,v 1.20 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/actions.h,v $ @@ -12,10 +12,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -56,27 +56,27 @@ }; -extern jb_err get_actions (char *line, +extern jb_err get_actions (char *line, struct action_alias * alias_list, struct action_spec *cur_action); extern void free_alias_list(struct action_alias *alias_list); extern void init_action(struct action_spec *dest); extern void free_action(struct action_spec *src); -extern jb_err merge_actions (struct action_spec *dest, +extern jb_err merge_actions (struct action_spec *dest, const struct action_spec *src); #if 0 extern int update_action_bits_for_all_tags(struct client_state *csp); #endif extern int update_action_bits_for_tag(struct client_state *csp, const char *tag); -extern jb_err copy_action (struct action_spec *dest, +extern jb_err copy_action (struct action_spec *dest, const struct action_spec *src); extern char * actions_to_text (const struct action_spec *action); extern char * actions_to_html (const struct client_state *csp, const struct action_spec *action); extern void init_current_action (struct current_action_spec *dest); extern void free_current_action (struct current_action_spec *src); -extern jb_err merge_current_action (struct current_action_spec *dest, +extern jb_err merge_current_action (struct current_action_spec *dest, const struct action_spec *src); extern char * current_action_to_html(const struct client_state *csp, const struct current_action_spec *action); diff -Nru privoxy-3.0.17/amiga.c privoxy-3.0.19/amiga.c --- privoxy-3.0.17/amiga.c 2009-06-21 19:21:10.000000000 +0000 +++ privoxy-3.0.19/amiga.c 2011-09-04 11:10:56.000000000 +0000 @@ -1,4 +1,4 @@ -const char amiga_rcs[] = "$Id: amiga.c,v 1.13 2009/05/16 13:27:20 fabiankeil Exp $"; +const char amiga_rcs[] = "$Id: amiga.c,v 1.14 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/amiga.c,v $ @@ -8,7 +8,7 @@ * Copyright : Written by and Copyright (C) 2001 the SourceForge * Privoxy team. http://www.privoxy.org/ * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/amiga.h privoxy-3.0.19/amiga.h --- privoxy-3.0.17/amiga.h 2009-06-21 19:21:10.000000000 +0000 +++ privoxy-3.0.19/amiga.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,7 +1,7 @@ #ifdef AMIGA #ifndef AMIGA_H_INCLUDED #define AMIGA_H_INCLUDED -#define AMIGA_H_VERSION "$Id: amiga.h,v 1.13 2009/05/16 13:27:20 fabiankeil Exp $" +#define AMIGA_H_VERSION "$Id: amiga.h,v 1.14 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/amiga.h,v $ @@ -11,7 +11,7 @@ * Copyright : Written by and Copyright (C) 2001 the SourceForge * Privoxy team. http://www.privoxy.org/ * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/AUTHORS privoxy-3.0.19/AUTHORS --- privoxy-3.0.17/AUTHORS 2010-02-15 15:48:12.000000000 +0000 +++ privoxy-3.0.19/AUTHORS 2011-12-26 18:42:00.000000000 +0000 @@ -7,8 +7,6 @@ David Schmidt, developer Hal Burgiss - Mark Miller - Gerry Murphy Lee Rian Roland Rosenfeld @@ -27,6 +25,8 @@ Adam Lock Guy Laroche Justin McMurtry + Mark Miller + Gerry Murphy Andreas Oesterhelt Haroon Rafique Georg Sauthoff @@ -51,6 +51,7 @@ Clifford Caoile Wan-Teh Chang Frédéric Crozat + Billy Crook Michael T. Davis Mattes Dolak Matthias Drochner @@ -75,9 +76,11 @@ Bert van Leeuwen Don Libes Paul Lieverse + Han Liu Toby Lyward Wil Mahan Jindrich Makovicka + Raphael Marichez Francois Marier David Mediavilla Raphael Moll @@ -91,6 +94,7 @@ Chung-chieh Shan Spinor S. Bart Schelstraete + Dan Stahlke Oliver Stoeneberg Peter Thoenen Martin Thomas diff -Nru privoxy-3.0.17/cgi.c privoxy-3.0.19/cgi.c --- privoxy-3.0.17/cgi.c 2010-05-24 11:38:22.000000000 +0000 +++ privoxy-3.0.19/cgi.c 2011-10-08 17:31:05.000000000 +0000 @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: cgi.c,v 1.129 2010/05/24 11:38:22 fabiankeil Exp $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.145 2011/10/08 17:31:05 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -7,18 +7,18 @@ * html or gif answers, and to compose HTTP resonses. * This only contains the framework functions, the * actual handler functions are declared elsewhere. - * + * * Functions declared include: - * + * * * Copyright : Written by and Copyright (C) 2001-2004, 2006-2008 * the SourceForge Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -49,6 +49,10 @@ #include #include +#ifdef FEATURE_COMPRESSION +#include +#endif + #include "project.h" #include "cgi.h" #include "list.h" @@ -81,126 +85,126 @@ "Privoxy main page", TRUE }, #ifdef FEATURE_GRACEFUL_TERMINATION - { "die", - cgi_die, + { "die", + cgi_die, "Shut down - Do not deploy this build in a production environment, " "this is a one click Denial Of Service attack!!!", - FALSE }, + FALSE }, #endif - { "show-status", - cgi_show_status, + { "show-status", + cgi_show_status, #ifdef FEATURE_CGI_EDIT_ACTIONS "View & change the current configuration", #else "View the current configuration", #endif - TRUE }, - { "show-version", - cgi_show_version, + TRUE }, + { "show-version", + cgi_show_version, "View the source code version numbers", - TRUE }, - { "show-request", - cgi_show_request, + TRUE }, + { "show-request", + cgi_show_request, "View the request headers", - TRUE }, + TRUE }, { "show-url-info", - cgi_show_url_info, + cgi_show_url_info, "Look up which actions apply to a URL and why", TRUE }, #ifdef FEATURE_TOGGLE { "toggle", - cgi_toggle, + cgi_toggle, "Toggle Privoxy on or off", FALSE }, #endif /* def FEATURE_TOGGLE */ #ifdef FEATURE_CGI_EDIT_ACTIONS { "edit-actions", /* Edit the actions list */ - cgi_edit_actions, + cgi_edit_actions, NULL, FALSE }, { "eaa", /* Shortcut for edit-actions-add-url-form */ - cgi_edit_actions_add_url_form, + cgi_edit_actions_add_url_form, NULL, FALSE }, { "eau", /* Shortcut for edit-actions-url-form */ - cgi_edit_actions_url_form, + cgi_edit_actions_url_form, NULL, FALSE }, { "ear", /* Shortcut for edit-actions-remove-url-form */ - cgi_edit_actions_remove_url_form, + cgi_edit_actions_remove_url_form, NULL, FALSE }, { "eal", /* Shortcut for edit-actions-list */ - cgi_edit_actions_list, + cgi_edit_actions_list, NULL, FALSE }, { "eafu", /* Shortcut for edit-actions-for-url */ - cgi_edit_actions_for_url, + cgi_edit_actions_for_url, NULL, FALSE }, { "eas", /* Shortcut for edit-actions-submit */ - cgi_edit_actions_submit, + cgi_edit_actions_submit, NULL, FALSE }, { "easa", /* Shortcut for edit-actions-section-add */ - cgi_edit_actions_section_add, + cgi_edit_actions_section_add, NULL, FALSE }, { "easr", /* Shortcut for edit-actions-section-remove */ - cgi_edit_actions_section_remove, + cgi_edit_actions_section_remove, NULL, FALSE }, { "eass", /* Shortcut for edit-actions-section-swap */ - cgi_edit_actions_section_swap, + cgi_edit_actions_section_swap, NULL, FALSE }, { "edit-actions-for-url", - cgi_edit_actions_for_url, + cgi_edit_actions_for_url, NULL, FALSE /* Edit the actions for (a) specified URL(s) */ }, { "edit-actions-list", - cgi_edit_actions_list, + cgi_edit_actions_list, NULL, TRUE /* Edit the actions list */ }, { "edit-actions-submit", - cgi_edit_actions_submit, + cgi_edit_actions_submit, NULL, FALSE /* Change the actions for (a) specified URL(s) */ }, { "edit-actions-url", - cgi_edit_actions_url, + cgi_edit_actions_url, NULL, FALSE /* Change a URL pattern in the actionsfile */ }, { "edit-actions-url-form", - cgi_edit_actions_url_form, + cgi_edit_actions_url_form, NULL, FALSE /* Form to change a URL pattern in the actionsfile */ }, { "edit-actions-add-url", - cgi_edit_actions_add_url, + cgi_edit_actions_add_url, NULL, FALSE /* Add a URL pattern to the actionsfile */ }, { "edit-actions-add-url-form", - cgi_edit_actions_add_url_form, + cgi_edit_actions_add_url_form, NULL, FALSE /* Form to add a URL pattern to the actionsfile */ }, { "edit-actions-remove-url", - cgi_edit_actions_remove_url, + cgi_edit_actions_remove_url, NULL, FALSE /* Remove a URL pattern from the actionsfile */ }, { "edit-actions-remove-url-form", - cgi_edit_actions_remove_url_form, + cgi_edit_actions_remove_url_form, NULL, FALSE /* Form to remove a URL pattern from the actionsfile */ }, { "edit-actions-section-add", - cgi_edit_actions_section_add, + cgi_edit_actions_section_add, NULL, FALSE /* Remove a section from the actionsfile */ }, { "edit-actions-section-remove", - cgi_edit_actions_section_remove, + cgi_edit_actions_section_remove, NULL, FALSE /* Remove a section from the actionsfile */ }, { "edit-actions-section-swap", - cgi_edit_actions_section_swap, + cgi_edit_actions_section_swap, NULL, FALSE /* Swap two sections in the actionsfile */ }, #endif /* def FEATURE_CGI_EDIT_ACTIONS */ - { "error-favicon.ico", - cgi_send_error_favicon, + { "error-favicon.ico", + cgi_send_error_favicon, NULL, TRUE /* Sends the favicon image for error pages. */ }, - { "favicon.ico", - cgi_send_default_favicon, + { "favicon.ico", + cgi_send_default_favicon, NULL, TRUE /* Sends the default favicon image. */ }, - { "robots.txt", - cgi_robots_txt, - NULL, TRUE /* Sends a robots.txt file to tell robots to go away. */ }, + { "robots.txt", + cgi_robots_txt, + NULL, TRUE /* Sends a robots.txt file to tell robots to go away. */ }, { "send-banner", - cgi_send_banner, + cgi_send_banner, NULL, TRUE /* Send a built-in image */ }, { "send-stylesheet", - cgi_send_stylesheet, + cgi_send_stylesheet, NULL, FALSE /* Send templates/cgi-style.css */ }, { "t", - cgi_transparent_image, + cgi_transparent_image, NULL, TRUE /* Send a transparent image (short name) */ }, { "url-info-osd.xml", - cgi_send_url_info_osd, + cgi_send_url_info_osd, NULL, TRUE /* Send templates/url-info-osd.xml */ }, { "user-manual", cgi_send_user_manual, @@ -267,6 +271,13 @@ const size_t image_pattern_length = sizeof(image_pattern_data) - 1; const size_t image_blank_length = sizeof(image_blank_data) - 1; +#ifdef FEATURE_COMPRESSION +/* + * Minimum length which a buffer has to reach before + * we bother to (re-)compress it. Completely arbitrary. + */ +const size_t LOWER_LENGTH_LIMIT_FOR_COMPRESSION = 1024U; +#endif static struct http_response cgi_error_memory_response[1]; @@ -276,7 +287,7 @@ /********************************************************************* - * + * * Function : dispatch_cgi * * Description : Checks if a request URL has either the magical @@ -338,7 +349,7 @@ return NULL; } - /* + /* * This is a CGI call. */ @@ -383,7 +394,7 @@ /********************************************************************* - * + * * Function : referrer_is_safe * * Description : Decides whether we trust the Referer for @@ -431,7 +442,7 @@ } /********************************************************************* - * + * * Function : dispatch_known_cgi * * Description : Processes a CGI once dispatch_cgi has determined that @@ -469,7 +480,7 @@ { query_args_start++; } - if (*query_args_start == '/') + if (*query_args_start == '/') { *query_args_start++ = '\0'; if ((param_list = new_map())) @@ -504,7 +515,7 @@ return cgi_error_memory(); } - /* + /* * Find and start the right CGI function */ d = cgi_dispatchers; @@ -547,7 +558,9 @@ if (err && (err != JB_ERR_MEMORY)) { /* Unexpected error! Shouldn't get here */ - log_error(LOG_LEVEL_ERROR, "Unexpected CGI error %d in top-level handler. Please file a bug report!", err); + log_error(LOG_LEVEL_ERROR, + "Unexpected CGI error %d in top-level handler. " + "Please file a bug report!", err); err = cgi_error_unknown(csp, rsp, err); } if (!err) @@ -566,8 +579,8 @@ d++; } } - - + + /********************************************************************* * * Function : parse_cgi_parameters @@ -593,7 +606,7 @@ return NULL; } - /* + /* * IE 5 does, of course, violate RFC 2316 Sect 4.1 and sends * the fragment identifier along with the request, so we must * cut it off here, so it won't pollute the CGI params: @@ -762,7 +775,7 @@ assert(name); assert(pvalue); - *pvalue = 0; + *pvalue = 0; param = lookup(parameters, name); if (!*param) @@ -854,7 +867,7 @@ if (!err) err = map(exports, "host", 1, html_encode(csp->http->host), 0); if (!err) err = map(exports, "hostport", 1, html_encode(csp->http->hostport), 0); if (!err) err = map(exports, "path", 1, html_encode_and_free_original(path), 0); - if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); + if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); if (!err) { err = map(exports, "host-ip", 1, html_encode(csp->http->host_ip_addr_str), 0); @@ -1037,17 +1050,17 @@ "Content-Type: text/html\r\n" "\r\n"; cgi_error_memory_response->body = - "\r\n" - "\r\n" - " 500 Internal Privoxy Error\r\n" + "\n" + "\n" + " 500 Internal Privoxy Error\n" " " - "\r\n" - "\r\n" - "

500 Internal Privoxy Error

\r\n" - "

Privoxy ran out of memory while processing your request.

\r\n" - "

Please contact your proxy administrator, or try again later

\r\n" - "\r\n" - "\r\n"; + "\n" + "\n" + "

500 Internal Privoxy Error

\n" + "

Privoxy ran out of memory while processing your request.

\n" + "

Please contact your proxy administrator, or try again later

\n" + "\n" + "\n"; cgi_error_memory_response->head_length = strlen(cgi_error_memory_response->head); @@ -1085,7 +1098,7 @@ * * Description : Almost-CGI function that is called if a template * cannot be loaded. Note this is not a true CGI, - * it takes a template name rather than a map of + * it takes a template name rather than a map of * parameters. * * Parameters : @@ -1095,7 +1108,7 @@ * be loaded. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_error_no_template(const struct client_state *csp, @@ -1105,18 +1118,18 @@ static const char status[] = "500 Internal Privoxy Error"; static const char body_prefix[] = - "\r\n" - "\r\n" - " 500 Internal Privoxy Error\r\n" + "\n" + "\n" + " 500 Internal Privoxy Error\n" " " - "\r\n" - "\r\n" - "

500 Internal Privoxy Error

\r\n" - "

Privoxy encountered an error while processing your request:

\r\n" + "\n" + "\n" + "

500 Internal Privoxy Error

\n" + "

Privoxy encountered an error while processing your request:

\n" "

Could not load template file "; static const char body_suffix[] = - " or one of its included components.

\r\n" - "

Please contact your proxy administrator.

\r\n" + " or one of its included components.

\n" + "

Please contact your proxy administrator.

\n" "

If you are the proxy administrator, please put the required file(s)" "in the (confdir)/templates directory. The " "location of the (confdir) directory " @@ -1125,9 +1138,9 @@ #ifndef _WIN32 ", or /etc/privoxy/" #endif /* ndef _WIN32 */ - ").

\r\n" - "\r\n" - "\r\n"; + ").

\n" + "\n" + "\n"; const size_t body_size = strlen(body_prefix) + strlen(template_name) + strlen(body_suffix) + 1; assert(csp); @@ -1182,7 +1195,7 @@ * 3 : error_to_report = Error code to report. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_error_unknown(const struct client_state *csp, @@ -1192,28 +1205,24 @@ static const char status[] = "500 Internal Privoxy Error"; static const char body_prefix[] = - "\r\n" - "\r\n" - " 500 Internal Privoxy Error\r\n" + "\n" + "\n" + " 500 Internal Privoxy Error\n" " " - "\r\n" - "\r\n" - "

500 Internal Privoxy Error

\r\n" - "

Privoxy encountered an error while processing your request:

\r\n" + "\n" + "\n" + "

500 Internal Privoxy Error

\n" + "

Privoxy encountered an error while processing your request:

\n" "

Unexpected internal error: "; static const char body_suffix[] = - "

\r\n" + "

\n" "

Please " "" - "file a bug report.

\r\n" - "\r\n" - "\r\n"; - char errnumbuf[30]; - /* - * Due to sizeof(errnumbuf), body_size will be slightly - * bigger than necessary but it doesn't really matter. - */ - const size_t body_size = strlen(body_prefix) + sizeof(errnumbuf) + strlen(body_suffix) + 1; + "file a bug report.

\n" + "\n" + "\n"; + /* Includes room for larger error numbers in the future. */ + const size_t body_size = sizeof(body_prefix) + sizeof(body_suffix) + 5; assert(csp); assert(rsp); @@ -1226,16 +1235,13 @@ rsp->is_static = 0; rsp->crunch_reason = INTERNAL_ERROR; - snprintf(errnumbuf, sizeof(errnumbuf), "%d", error_to_report); - rsp->body = malloc(body_size); if (rsp->body == NULL) { return JB_ERR_MEMORY; } - strlcpy(rsp->body, body_prefix, body_size); - strlcat(rsp->body, errnumbuf, body_size); - strlcat(rsp->body, body_suffix, body_size); + + snprintf(rsp->body, body_size, "%s%d%s", body_prefix, error_to_report, body_suffix); rsp->status = strdup(status); if (rsp->status == NULL) @@ -1253,7 +1259,7 @@ * * Description : CGI function that is called if the parameters * (query string) for a CGI were wrong. - * + * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : rsp = http_response data structure for output @@ -1261,7 +1267,7 @@ * CGI Parameters : none * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_error_bad_param(const struct client_state *csp, @@ -1283,7 +1289,7 @@ /********************************************************************* * - * Function : cgi_redirect + * Function : cgi_redirect * * Description : CGI support function to generate a HTTP redirect * message @@ -1295,7 +1301,7 @@ * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_redirect (struct http_response * rsp, const char *target) @@ -1330,8 +1336,8 @@ * FIXME: I currently only work for actions, and would * like to be generalized for other topics. * - * Parameters : - * 1 : item = item (will NOT be free()d.) + * Parameters : + * 1 : item = item (will NOT be free()d.) * It is assumed to be HTML-safe. * 2 : config = The current configuration. * @@ -1376,7 +1382,7 @@ * HTTP header - e.g.: * "Sun, 06 Nov 1994 08:49:37 GMT" * - * Parameters : + * Parameters : * 1 : time_offset = Time returned will be current time * plus this number of seconds. * 2 : buf = Destination for result. @@ -1389,12 +1395,6 @@ *********************************************************************/ void get_http_time(int time_offset, char *buf, size_t buffer_size) { - static const char day_names[7][4] = - { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; - static const char month_names[12][4] = - { "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; - struct tm *t; time_t current_time; #if defined(HAVE_GMTIME_R) @@ -1419,17 +1419,7 @@ t = gmtime(¤t_time); #endif - /* Format: "Sun, 06 Nov 1994 08:49:37 GMT" */ - snprintf(buf, buffer_size, - "%s, %02d %s %4d %02d:%02d:%02d GMT", - day_names[t->tm_wday], - t->tm_mday, - month_names[t->tm_mon], - t->tm_year + 1900, - t->tm_hour, - t->tm_min, - t->tm_sec - ); + strftime(buf, buffer_size, "%a, %d %b %Y %H:%M:%S GMT", t); } @@ -1479,6 +1469,63 @@ } + +#ifdef FEATURE_COMPRESSION +/********************************************************************* + * + * Function : compress_buffer + * + * Description : Compresses the content of a buffer with zlib's deflate + * Allocates a new buffer for the result, free'ing it is + * up to the caller. + * + * Parameters : + * 1 : buffer = buffer whose content should be compressed + * 2 : buffer_length = length of the buffer + * 3 : compression_level = compression level for compress2() + * + * Returns : NULL on error, otherwise a pointer to the compressed + * content of the input buffer. + * + *********************************************************************/ +char *compress_buffer(char *buffer, size_t *buffer_length, int compression_level) +{ + char *compressed_buffer; + uLongf new_length; + assert(-1 <= compression_level && compression_level <= 9); + + /* Let zlib figure out the maximum length of the compressed data */ + new_length = compressBound((uLongf)*buffer_length); + + compressed_buffer = malloc(new_length); + if (NULL == compressed_buffer) + { + log_error(LOG_LEVEL_FATAL, + "Out of memory allocation compression buffer."); + } + + if (Z_OK != compress2((Bytef *)compressed_buffer, &new_length, + (Bytef *)buffer, *buffer_length, compression_level)) + { + log_error(LOG_LEVEL_ERROR, + "compress2() failed. Buffer size: %d, compression level: %d.", + new_length, compression_level); + freez(compressed_buffer); + return NULL; + } + + log_error(LOG_LEVEL_RE_FILTER, + "Compressed content from %d to %d bytes. Compression level: %d", + *buffer_length, new_length, compression_level); + + *buffer_length = (size_t)new_length; + + return compressed_buffer; + +} +#endif + + /********************************************************************* * * Function : finish_http_response @@ -1508,7 +1555,7 @@ return rsp; } - /* + /* * Fill in the HTTP Status, using HTTP/1.1 * unless the client asked for HTTP/1.0. */ @@ -1517,13 +1564,31 @@ rsp->status ? rsp->status : "200 OK"); err = enlist_first(rsp->headers, buf); - /* + /* * Set the Content-Length */ if (rsp->content_length == 0) { rsp->content_length = rsp->body ? strlen(rsp->body) : 0; } + +#ifdef FEATURE_COMPRESSION + if (!err && (csp->flags & CSP_FLAG_CLIENT_SUPPORTS_DEFLATE) + && (rsp->content_length > LOWER_LENGTH_LIMIT_FOR_COMPRESSION)) + { + char *compressed_content; + + compressed_content = compress_buffer(rsp->body, &rsp->content_length, + csp->config->compression_level); + if (NULL != compressed_content) + { + freez(rsp->body); + rsp->body = compressed_content; + err = enlist_unique_header(rsp->headers, "Content-Encoding", "deflate"); + } + } +#endif + if (!err) { snprintf(buf, sizeof(buf), "Content-Length: %d", (int)rsp->content_length); @@ -1565,7 +1630,7 @@ * Last-Modified: set to date/time the page was last changed. * Expires: set to date/time page next needs reloading. * Cache-Control: set to "no-cache" if applicable. - * + * * See http://www.w3.org/Protocols/rfc2068/rfc2068 */ if (rsp->is_static) @@ -1641,7 +1706,7 @@ err = enlist_unique_header(rsp->headers, "Connection", "close"); } - /* + /* * Write the head */ if (err || (NULL == (rsp->head = list_to_text(rsp->headers)))) @@ -1721,11 +1786,11 @@ * following an #include statament * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * JB_ERR_FILE if the template file cannot be read * *********************************************************************/ -jb_err template_load(const struct client_state *csp, char **template_ptr, +jb_err template_load(const struct client_state *csp, char **template_ptr, const char *templatename, int recursive) { jb_err err; @@ -1807,7 +1872,7 @@ } free(full_path); - /* + /* * Read the file, ignoring comments, and honoring #include * statements, unless we're already called recursively. * @@ -1862,7 +1927,7 @@ * HTML template by replacing @name@ with value using * pcrs, for each item in the output map. * - * Note that a leading '$' charachter in the export map's + * Note that a leading '$' character in the export map's * values will be stripped and toggle on backreference * interpretation. * @@ -1895,7 +1960,7 @@ file_buffer = *template_ptr; size = strlen(file_buffer) + 1; - /* + /* * Assemble pcrs joblist from exports map */ for (m = exports->first; m != NULL; m = m->next) @@ -1913,7 +1978,7 @@ else { /* - * Treat the "replace with" text as a literal string - + * Treat the "replace with" text as a literal string - * no quoting needed, no backreferences allowed. * ("Trivial" ['T'] flag). */ @@ -1927,7 +1992,7 @@ /* Make and run job. */ job = pcrs_compile(buf, m->value, flags, &error); - if (job == NULL) + if (job == NULL) { if (error == PCRS_ERR_NOMEM) { @@ -1954,10 +2019,10 @@ if (error < 0) { - /* + /* * Substitution failed, keep the original buffer, * log the problem and ignore it. - * + * * The user might see some unresolved @CGI_VARIABLES@, * but returning a special CGI error page seems unreasonable * and could mask more important error messages. @@ -2009,7 +2074,7 @@ struct http_response *rsp) { jb_err err; - + assert(csp); assert(templatename); assert(exports); @@ -2054,6 +2119,7 @@ struct map * exports; int local_help_exists = 0; char *ip_address = NULL; + char *port = NULL; char *hostname = NULL; assert(csp); @@ -2066,12 +2132,12 @@ if (csp->config->hostname) { - get_host_information(csp->cfd, &ip_address, NULL); + get_host_information(csp->cfd, &ip_address, &port, NULL); hostname = strdup(csp->config->hostname); } else { - get_host_information(csp->cfd, &ip_address, &hostname); + get_host_information(csp->cfd, &ip_address, &port, &hostname); } err = map(exports, "version", 1, html_encode(VERSION), 0); @@ -2079,6 +2145,8 @@ if (!err) err = map(exports, "time", 1, html_encode(buf), 0); if (!err) err = map(exports, "my-ip-address", 1, html_encode(ip_address ? ip_address : "unknown"), 0); freez(ip_address); + if (!err) err = map(exports, "my-port", 1, html_encode(port ? port : "unkown"), 0); + freez(port); if (!err) err = map(exports, "my-hostname", 1, html_encode(hostname ? hostname : "unknown"), 0); freez(hostname); if (!err) err = map(exports, "homepage", 1, html_encode(HOME_PAGE_URL), 0); @@ -2103,9 +2171,6 @@ if (!err) err = map_block_killer(exports, "can-toggle"); #endif - snprintf(buf, sizeof(buf), "%d", csp->config->hport); - if (!err) err = map(exports, "my-port", 1, buf, 1); - if(!strcmp(CODE_STATUS, "stable")) { if (!err) err = map_block_killer(exports, "unstable"); @@ -2156,12 +2221,12 @@ * "if--start.*if--end" to the given * export list. * - * Parameters : + * Parameters : * 1 : exports = map to extend * 2 : name = name of conditional block * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err map_block_killer(struct map *exports, const char *name) @@ -2185,12 +2250,12 @@ * by map-block-killer, to save a few bytes. * i.e. removes "@if--start@" and "@if--end@" * - * Parameters : + * Parameters : * 1 : exports = map to extend * 2 : name = name of conditional block * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err map_block_keep(struct map *exports, const char *name) @@ -2231,13 +2296,13 @@ * The control structure and one of the alternatives * will be hidden. * - * Parameters : + * Parameters : * 1 : exports = map to extend * 2 : name = name of conditional block * 3 : choose_first = nonzero for first, zero for second. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err map_conditional(struct map *exports, const char *name, int choose_first) @@ -2269,7 +2334,7 @@ * * Function : make_menu * - * Description : Returns an HTML-formatted menu of the available + * Description : Returns an HTML-formatted menu of the available * unhidden CGIs, excluding the one given in * and the toggle CGI if toggling is disabled. * @@ -2277,7 +2342,7 @@ * 1 : self = name of CGI to leave out, can be NULL for * complete listing. * 2 : feature_flags = feature bitmap from csp->config - * + * * * Returns : menu string, or NULL on out-of-memory error. * @@ -2318,7 +2383,7 @@ html_encoded_prefix = html_encode(CGI_PREFIX); if (html_encoded_prefix == NULL) { - return NULL; + return NULL; } else { diff -Nru privoxy-3.0.17/cgiedit.c privoxy-3.0.19/cgiedit.c --- privoxy-3.0.17/cgiedit.c 2009-06-21 19:21:11.000000000 +0000 +++ privoxy-3.0.19/cgiedit.c 2011-11-18 16:47:08.000000000 +0000 @@ -1,4 +1,4 @@ -const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.67 2009/05/19 17:46:24 fabiankeil Exp $"; +const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.71 2011/11/18 16:47:08 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $ @@ -85,10 +85,10 @@ { /** Next entry in the linked list */ struct file_line * next; - + /** The raw data, to write out if this line is unmodified. */ char * raw; - + /** Comments and/or whitespace to put before this line if it's modified and then written out. */ char * prefix; @@ -97,7 +97,7 @@ are performed on the data read from file before it's stored here, so it will be a single line of data. */ char * unprocessed; - + /** The type of data on this line. One of the FILE_LINE_xxx constants. */ int type; @@ -321,15 +321,10 @@ static jb_err map_copy_parameter_html(struct map *out, const struct map *in, const char *name); -#if 0 /* unused function */ -static jb_err map_copy_parameter_url(struct map *out, - const struct map *in, - const char *name); -#endif /* unused function */ - -static jb_err get_file_name_param(struct client_state *csp, - const struct map *parameters, - const char *param_name, + +static jb_err get_file_name_param(struct client_state *csp, + const struct map *parameters, + const char *param_name, const char **pfilename); /* Internal convenience functions */ @@ -433,56 +428,6 @@ } -#if 0 /* unused function */ -/********************************************************************* - * - * Function : map_copy_parameter_url - * - * Description : Copy a CGI parameter from one map to another, URL - * encoding it. - * - * Parameters : - * 1 : out = target map - * 2 : in = source map - * 3 : name = name of cgi parameter to copy - * - * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory - * JB_ERR_CGI_PARAMS if the parameter doesn't exist - * in the source map - * - *********************************************************************/ -static jb_err map_copy_parameter_url(struct map *out, - const struct map *in, - const char *name) -{ - const char * value; - jb_err err; - - assert(out); - assert(in); - assert(name); - - value = lookup(in, name); - err = map(out, name, 1, url_encode(value), 0); - - if (err) - { - /* Out of memory */ - return err; - } - else if (*value == '\0') - { - return JB_ERR_CGI_PARAMS; - } - else - { - return JB_ERR_OK; - } -} -#endif /* 0 - unused function */ - - /********************************************************************* * * Function : cgi_edit_actions_url_form @@ -707,7 +652,7 @@ if (cur_line->type == FILE_LINE_ACTION) { section_start_line_number = line_number; - } + } cur_line = cur_line->next; } @@ -1483,7 +1428,7 @@ if (rval) { /* Out of memory or empty file. */ - /* Note that empty file is not an error we propogate up */ + /* Note that empty file is not an error we propagate up */ free(cur_line); return ((rval == JB_ERR_FILE) ? JB_ERR_OK : rval); } @@ -1734,7 +1679,7 @@ { log_error(LOG_LEVEL_INFO, "Timestamp mismatch limit reached, turning CGI editor off. " - "Reload the configuration file to reenable it."); + "Reload the configuration file to re-enable it."); csp->config->feature_flags &= ~RUNTIME_FEATURE_CGI_EDIT_ACTIONS; } } @@ -2873,7 +2818,7 @@ if (!err) err = actions_to_radio(exports, cur_line->data.action); /* - * XXX: Some browsers (at least IE6 and IE7) have an artifical URL + * XXX: Some browsers (at least IE6 and IE7) have an artificial URL * length limitation and ignore clicks on the Submit buttons if * the resulting GET URL would be longer than their limit. * @@ -2882,7 +2827,7 @@ * browsers (BR #1570678). * * The config option split-large-forms works around this browser - * bug (HTTP has no URL lenght limitation) by deviding the action + * bug (HTTP has no URL length limitation) by deviding the action * list form into multiple smaller ones. It means the URLs are shorter * and work in broken browsers as well, but the user can no longer change * all actions with one submit. @@ -3415,7 +3360,7 @@ if (cur_line->type == FILE_LINE_ACTION) { section_start_line_number = line_number; - } + } cur_line = cur_line->next; line_number++; } @@ -4183,7 +4128,7 @@ * * Description : Converts a string into a form JavaScript will like. * - * Netscape 4's JavaScript sucks - it doesn't use + * Netscape 4's JavaScript sucks - it doesn't use * "id" parameters, so you have to set the "name" * used to submit a form element to something JavaScript * will like. (Or access the elements by index in an diff -Nru privoxy-3.0.17/cgiedit.h privoxy-3.0.19/cgiedit.h --- privoxy-3.0.17/cgiedit.h 2009-06-21 19:21:11.000000000 +0000 +++ privoxy-3.0.19/cgiedit.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,23 +1,23 @@ #ifndef CGIEDIT_H_INCLUDED #define CGIEDIT_H_INCLUDED -#define CGIEDIT_H_VERSION "$Id: cgiedit.h,v 1.11 2009/05/16 13:27:20 fabiankeil Exp $" +#define CGIEDIT_H_VERSION "$Id: cgiedit.h,v 1.12 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgiedit.h,v $ * * Purpose : CGI-based actionsfile editor. - * + * * Functions declared include: - * + * * * Copyright : Written by and Copyright (C) 2001 the SourceForge * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/cgi.h privoxy-3.0.19/cgi.h --- privoxy-3.0.17/cgi.h 2009-06-21 19:21:10.000000000 +0000 +++ privoxy-3.0.19/cgi.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,24 +1,24 @@ #ifndef CGI_H_INCLUDED #define CGI_H_INCLUDED -#define CGI_H_VERSION "$Id: cgi.h,v 1.37 2009/06/11 11:44:25 fabiankeil Exp $" +#define CGI_H_VERSION "$Id: cgi.h,v 1.41 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.h,v $ * * Purpose : Declares functions to intercept request, generate * html or gif answers, and to compose HTTP resonses. - * + * * Functions declared include: - * + * * * Copyright : Written by and Copyright (C) 2001-2009 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -69,7 +69,7 @@ extern jb_err map_block_keep (struct map *exports, const char *name); extern jb_err map_conditional (struct map *exports, const char *name, int choose_first); -extern jb_err template_load(const struct client_state *csp, char ** template_ptr, +extern jb_err template_load(const struct client_state *csp, char ** template_ptr, const char *templatename, int recursive); extern jb_err template_fill(char ** template_ptr, const struct map *exports); extern jb_err template_fill_for_cgi(const struct client_state *csp, @@ -101,6 +101,14 @@ const char **pparam); extern char get_char_param(const struct map *parameters, const char *param_name); +#ifdef FEATURE_COMPRESSION +/* + * Minimum length which a buffer has to reach before + * we bother to (re-)compress it. Completely arbitrary. + */ +extern const size_t LOWER_LENGTH_LIMIT_FOR_COMPRESSION; +extern char *compress_buffer(char *buffer, size_t *buffer_length, int compression_level); +#endif /* * Text generators diff -Nru privoxy-3.0.17/cgisimple.c privoxy-3.0.19/cgisimple.c --- privoxy-3.0.17/cgisimple.c 2010-03-28 18:02:22.000000000 +0000 +++ privoxy-3.0.19/cgisimple.c 2011-09-04 11:10:56.000000000 +0000 @@ -1,22 +1,22 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.99 2010/03/28 18:02:22 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.111 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ * * Purpose : Simple CGIs to get information about Privoxy's * status. - * + * * Functions declared include: - * * - * Copyright : Written by and Copyright (C) 2001-2010 the + * + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -80,7 +80,7 @@ * Description : CGI function that is called for the CGI_SITE_1_HOST * and CGI_SITE_2_HOST/CGI_SITE_2_PATH base URLs. * Boring - only exports the default exports. - * + * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : rsp = http_response data structure for output @@ -118,7 +118,7 @@ * * Description : CGI function that is called if an unknown action was * given. - * + * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : rsp = http_response data structure for output @@ -127,7 +127,7 @@ * CGI Parameters : none * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_error_404(struct client_state *csp, @@ -165,7 +165,7 @@ * NOTE: Turning this on in a production build * would be a BAD idea. An EXTREMELY BAD idea. * In short, don't do it. - * + * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : rsp = http_response data structure for output @@ -174,13 +174,27 @@ * CGI Parameters : none * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_die (struct client_state *csp, struct http_response *rsp, const struct map *parameters) { + static const char status[] = "200 OK Privoxy shutdown request received"; + static const char body[] = + "\n" + "\n" + " Privoxy shutdown request received\n" + " \n" + " \n" + "\n" + "\n" + "

Privoxy shutdown request received

\n" + "

Privoxy is going to shut down after the next request.

\n" + "\n" + "\n"; + assert(csp); assert(rsp); assert(parameters); @@ -188,12 +202,21 @@ /* quit */ g_terminate = 1; - /* - * I don't really care what gets sent back to the browser. - * Take the easy option - "out of memory" page. - */ + csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; - return JB_ERR_MEMORY; + rsp->content_length = 0; + rsp->head_length = 0; + rsp->is_static = 0; + + rsp->body = strdup(body); + rsp->status = strdup(status); + + if ((rsp->body == NULL) || (rsp->status == NULL)) + { + return JB_ERR_MEMORY; + } + + return JB_ERR_OK; } #endif /* def FEATURE_GRACEFUL_TERMINATION */ @@ -204,7 +227,7 @@ * * Description : Show the client's request and what sed() would have * made of it. - * + * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * 2 : rsp = http_response data structure for output @@ -213,7 +236,7 @@ * CGI Parameters : none * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_show_request(struct client_state *csp, @@ -231,7 +254,7 @@ { return JB_ERR_MEMORY; } - + /* * Repair the damage done to the IOB by get_header() */ @@ -266,7 +289,7 @@ * * Function : cgi_send_banner * - * Description : CGI function that returns a banner. + * Description : CGI function that returns a banner. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) @@ -281,7 +304,7 @@ * equivalent). * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_banner(struct client_state *csp, @@ -294,7 +317,7 @@ * If type is auto, then determine the right thing * to do from the set-image-blocker action */ - if (imagetype == 'a') + if (imagetype == 'a') { /* * Default to pattern @@ -345,14 +368,14 @@ } #endif /* def FEATURE_IMAGE_BLOCKING */ } - + /* * Now imagetype is either the non-auto type we were called with, * or it was auto and has since been determined. In any case, we * can proceed to actually answering the request by sending a redirect * or an image as appropriate: */ - if (imagetype == 'r') + if (imagetype == 'r') { rsp->status = strdup("302 Local Redirect from Privoxy"); if (rsp->status == NULL) @@ -367,7 +390,7 @@ } else { - if ((imagetype == 'b') || (imagetype == 't')) + if ((imagetype == 'b') || (imagetype == 't')) { rsp->body = bindup(image_blank_data, image_blank_length); rsp->content_length = image_blank_length; @@ -409,7 +432,7 @@ * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_transparent_image(struct client_state *csp, @@ -453,7 +476,7 @@ * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_default_favicon(struct client_state *csp, @@ -514,7 +537,7 @@ * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_error_favicon(struct client_state *csp, @@ -576,7 +599,7 @@ * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_stylesheet(struct client_state *csp, @@ -584,7 +607,7 @@ const struct map *parameters) { jb_err err; - + assert(csp); assert(rsp); @@ -630,7 +653,7 @@ * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_url_info_osd(struct client_state *csp, @@ -660,6 +683,48 @@ /********************************************************************* * + * Function : get_content_type + * + * Description : Use the file extension to guess the content type + * header we should use to serve the file. + * + * Parameters : + * 1 : filename = Name of the file whose content type + * we care about + * + * Returns : The guessed content type. + * + *********************************************************************/ +static const char *get_content_type(const char *filename) +{ + int i; + struct content_type + { + const char *extension; + const char *content_type; + }; + static const struct content_type content_types[] = + { + {".css", "text/css"}, + {".jpg", "image/jpeg"}, + {".jpeg", "image/jpeg"}, + {".png", "image/png"}, + }; + + for (i = 0; i < SZ(content_types); i++) + { + if (strstr(filename, content_types[i].extension)) + { + return content_types[i].content_type; + } + } + + /* No match by extension, default to html */ + return "text/html"; +} + +/********************************************************************* + * * Function : cgi_send_user_manual * * Description : CGI function that sends a file in the user @@ -674,17 +739,17 @@ * (relative to user-manual from config) * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_send_user_manual(struct client_state *csp, struct http_response *rsp, const struct map *parameters) { - const char * filename; + const char *filename; char *full_path; jb_err err = JB_ERR_OK; - size_t length; + const char *content_type; assert(csp); assert(rsp); @@ -704,17 +769,24 @@ } get_string_param(parameters, "file", &filename); - /* Check paramter for hack attempts */ - if (filename && strchr(filename, '/')) + if (filename == NULL) { - return JB_ERR_CGI_PARAMS; + /* It's '/' so serve the index.html if there is one. */ + filename = "index.html"; } - if (filename && strstr(filename, "..")) + else if (NULL != strchr(filename, '/') || NULL != strstr(filename, "..")) { + /* + * We currently only support a flat file + * hierarchy for the documentation. + */ + log_error(LOG_LEVEL_ERROR, + "Rejecting the request to serve '%s' as it contains '/' or '..'", + filename); return JB_ERR_CGI_PARAMS; } - full_path = make_path(csp->config->usermanual, filename ? filename : "index.html"); + full_path = make_path(csp->config->usermanual, filename); if (full_path == NULL) { return JB_ERR_MEMORY; @@ -733,29 +805,12 @@ } freez(full_path); - /* Guess correct Content-Type based on the filename's ending */ - if (filename) - { - length = strlen(filename); - } - else - { - length = 0; - } - if((length>=4) && !strcmp(&filename[length-4], ".css")) - { - err = enlist(rsp->headers, "Content-Type: text/css"); - } - else if((length>=4) && !strcmp(&filename[length-4], ".jpg")) - { - err = enlist(rsp->headers, "Content-Type: image/jpeg"); - } - else - { - err = enlist(rsp->headers, "Content-Type: text/html"); - } + content_type = get_content_type(filename); + log_error(LOG_LEVEL_CGI, + "Content-Type guessed for %s: %s", filename, content_type); + + return enlist_unique_header(rsp->headers, "Content-Type", content_type); - return err; } @@ -774,7 +829,7 @@ * CGI Parameters : none * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_show_version(struct client_state *csp, @@ -823,7 +878,7 @@ * Default is to show menu and other information. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_show_status(struct client_state *csp, @@ -869,7 +924,7 @@ if (!err) err = map(exports, "options", 1, csp->config->proxy_args, 1); if (!err) err = show_defines(exports); - if (err) + if (err) { free_map(exports); return JB_ERR_MEMORY; @@ -913,8 +968,8 @@ #else /* ndef FEATURE_STATISTICS */ err = err || map_block_killer(exports, "statistics"); #endif /* ndef FEATURE_STATISTICS */ - - /* + + /* * List all action files in use, together with view and edit links, * except for standard.action, which should only be viewable. (Not * enforced in the editor itself) @@ -955,7 +1010,7 @@ if (!err) err = string_append(&s, "\n"); } } - if (*s != '\0') + if (*s != '\0') { if (!err) err = map(exports, "actions-filenames", 1, s, 0); } @@ -964,7 +1019,7 @@ if (!err) err = map(exports, "actions-filenames", 1, "None specified", 1); } - /* + /* * List all re_filterfiles in use, together with view options. * FIXME: Shouldn't include hardwired HTML here, use line template instead! */ @@ -981,7 +1036,7 @@ if (!err) err = string_append(&s, "\n"); } } - if (*s != '\0') + if (*s != '\0') { if (!err) err = map(exports, "re-filter-filenames", 1, s, 0); } @@ -1021,7 +1076,7 @@ return template_fill_for_cgi(csp, "show-status", exports, rsp); } - + /********************************************************************* * * Function : cgi_show_url_info @@ -1042,7 +1097,7 @@ * the template. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_show_url_info(struct client_state *csp, @@ -1160,7 +1215,7 @@ struct http_request url_to_query[1]; struct current_action_spec action[1]; int i; - + if (map(exports, "url", 1, html_encode(url_param), 0)) { free(url_param); @@ -1448,7 +1503,7 @@ * CGI Parameters : None * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ jb_err cgi_robots_txt(struct client_state *csp, @@ -1496,7 +1551,7 @@ * 1 : exports = map to extend * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ static jb_err show_defines(struct map *exports) @@ -1521,6 +1576,12 @@ if (!err) err = map_conditional(exports, "FEATURE_CGI_EDIT_ACTIONS", 0); #endif /* ndef FEATURE_CGI_EDIT_ACTIONS */ +#ifdef FEATURE_COMPRESSION + if (!err) err = map_conditional(exports, "FEATURE_COMPRESSION", 1); +#else /* ifndef FEATURE_COMPRESSION */ + if (!err) err = map_conditional(exports, "FEATURE_COMPRESSION", 0); +#endif /* ndef FEATURE_COMPRESSION */ + #ifdef FEATURE_CONNECTION_KEEP_ALIVE if (!err) err = map_conditional(exports, "FEATURE_CONNECTION_KEEP_ALIVE", 1); #else /* ifndef FEATURE_CONNECTION_KEEP_ALIVE */ @@ -1740,7 +1801,7 @@ * Default is to show menu and other information. * * Returns : JB_ERR_OK on success - * JB_ERR_MEMORY on out-of-memory error. + * JB_ERR_MEMORY on out-of-memory error. * *********************************************************************/ static jb_err cgi_show_file(struct client_state *csp, @@ -1834,7 +1895,7 @@ return JB_ERR_CGI_PARAMS; } - + /********************************************************************* * * Function : load_file @@ -1861,6 +1922,7 @@ fp = fopen(filename, "rb"); if (NULL == fp) { + log_error(LOG_LEVEL_ERROR, "Failed to open %s: %E", filename); return JB_ERR_FILE; } diff -Nru privoxy-3.0.17/cgisimple.h privoxy-3.0.19/cgisimple.h --- privoxy-3.0.17/cgisimple.h 2009-06-21 19:21:11.000000000 +0000 +++ privoxy-3.0.19/cgisimple.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,24 +1,24 @@ #ifndef CGISIMPLE_H_INCLUDED #define CGISIMPLE_H_INCLUDED -#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.17 2009/05/16 13:27:20 fabiankeil Exp $" +#define CGISIMPLE_H_VERSION "$Id: cgisimple.h,v 1.18 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.h,v $ * * Purpose : Declares functions to intercept request, generate * html or gif answers, and to compose HTTP resonses. - * + * * Functions declared include: - * + * * * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/ChangeLog privoxy-3.0.19/ChangeLog --- privoxy-3.0.17/ChangeLog 2010-11-13 20:16:07.000000000 +0000 +++ privoxy-3.0.19/ChangeLog 2011-12-26 17:03:47.000000000 +0000 @@ -1,10 +1,375 @@ -------------------------------------------------------------------- ChangeLog for Privoxy -------------------------------------------------------------------- +*** Version 3.0.19 Stable *** + +- Bug fixes: + - Prevent a segmentation fault when de-chunking buffered content. + It could be triggered by malicious web servers if Privoxy was + configured to filter the content and running on a platform + where SIZE_T_MAX isn't larger than UINT_MAX, which probably + includes most 32-bit systems. On those platforms, all Privoxy + versions before 3.0.19 appear to be affected. + To be on the safe side, this bug should be presumed to allow + code execution as proving that it doesn't seems unrealistic. + - Do not expect a response from the SOCKS4/4A server until it + got something to respond to. This regression was introduced + in 3.0.18 and prevented the SOCKS4/4A negotiation from working. + Reported by qqqqqw in #3459781. + +- General improvements: + - Fix an off-by-one in an error message about connect failures. + - Use a GNUMakefile variable for the webserver root directory and + update the path. Sourceforge changed it which broke various + web-related targets. + - Update the CODE_STATUS description. + +*** Version 3.0.18 Stable *** + +- Bug fixes: + - If a generated redirect URL contains characters RFC 3986 doesn't + permit, they are (re)encoded. Not doing this makes Privoxy versions + from 3.0.5 to 3.0.17 susceptible to HTTP response splitting (CWE-113) + attacks if the +fast-redirects{check-decoded-url} action is used. + - Fix a logic bug that could cause Privoxy to reuse a server + socket after it got tainted by a server-header-tagger-induced + block that was triggered before the whole server response had + been read. If keep-alive was enabled and the request following + the blocked one was to the same host and using the same forwarding + settings, Privoxy would send it on the tainted server socket. + While the server would simply treat it as a pipelined request, + Privoxy would later on fail to properly parse the server's + response as it would try to parse the unread data from the + first response as server headers for the second one. + Regression introduced in 3.0.17. + - When implying keep-alive in client_connection(), remember that + the client didn't. Fixes a regression introduced in 3.0.13 that + would cause Privoxy to wait for additional client requests after + receiving a HTTP/1.1 request with "Connection: close" set + and connection sharing enabled. + With clients which terminates the client connection after detecting + that the whole body has been received it doesn't really matter, + but with clients that don't the connection would be kept open until + it timed out. + - Fix a subtle race condition between prepare_csp_for_next_request() + and sweep(). A thread preparing itself for the next client request + could briefly appear to be inactive. + If all other threads were already using more recent files, + the thread could get its files swept away under its feet. + So far this has only been reproduced while stress testing in + valgrind while touching action files in a loop. It's unlikely + to have caused any actual problems in the real world. + - Disable filters if SDCH compression is used unless filtering is forced. + If SDCH was combined with a supported compression algorithm, Privoxy + previously could try to decompress it and ditch the Content-Encoding + header even though the SDCH compression wasn't dealt with. + Reported by zebul666 in #3225863. + - Make a copy of the --user value and only mess with that when splitting + user and group. On some operating systems modifying the value directly + is reflected in the output of ps and friends and can be misleading. + Reported by zepard in #3292710. + - If forwarded-connect-retries is set, only retry if Privoxy is actually + forwarding the request. Previously direct connections would be retried + as well. + - Fixed a small memory leak when retrying connections with IPv6 + support enabled. + - Remove an incorrect assertion in compile_dynamic_pcrs_job_list() + It could be triggered by a pcrs job with an invalid pcre + pattern (for example one that contains a lone quantifier). + - If the --user argument user[.group] contains a dot, always bail out + if no group has been specified. Previously the intended, but undocumented + (and apparently untested), behaviour was to try interpreting the whole + argument as user name, but the detection was flawed and checked for '0' + instead of '\0', thus merely preventing group names beginning with a zero. + - In html_code_map[], use a numeric character reference instead of ' + which wasn't standardized before XHTML 1.0. + - Fix an invalid free when compiled with FEATURE_GRACEFUL_TERMINATION + and shut down through http://config.privoxy.org/die + - In get_actions(), fix the "temporary" backwards compatibility hack + to accept block actions without reason. + It also covered other actions that should be rejected as invalid. + Reported by Billy Crook. + +- General improvements: + - Privoxy can (re)compress buffered content before delivering + it to the client. Disabled by default as most users wouldn't + benefit from it. + - The +fast-redirects{check-decoded-url} action checks URL + segments separately. If there are other parameters behind + the redirect URL, this makes it unnecessary to cut them off + by additionally using a +redirect{} pcrs command. + Initial patch submitted by Jamie Zawinski in #3429848. + - When loading action sections, verify that the referenced filters + exist. Currently missing filters only result in an error message, + but eventually the severity will be upgraded to fatal. + - Allow to bind to multiple separate addresses. + Patch set submitted by Petr Pisar in #3354485. + - Set socket_error to errno if connecting fails in rfc2553_connect_to(). + Previously rejected direct connections could be incorrectly reported + as DNS issues if Privoxy was compiled with IPv6 support. + - Adjust url_code_map[] so spaces are replaced with %20 instead of '+' + While '+' can be used by client's submitting form data, this is not + actually what Privoxy is using the lookups for. This is more of a + cosmetic issue and doesn't fix any known problems. + - When compiled without FEATURE_FAST_REDIRECTS, do not silently + ignore +fast-redirect{} directives + - Added a workaround for GNU libc's strptime() reporting negative + year values when the parsed year is only specified with two digits. + On affected systems cookies with such a date would not be turned + into session cookies by the +session-cookies-only action. + Reported by Vaeinoe in #3403560 + - Fixed bind failures with certain GNU libc versions if no non-loopback + IP address has been configured on the system. This is mainly an issue + if the system is using DHCP and Privoxy is started before the network + is completely configured. + Reported by Raphael Marichez in #3349356. + Additional insight from Petr Pisar. + - Privoxy log messages now use the ISO 8601 date format %Y-%m-%d. + It's only slightly longer than the old format, but contains + the full date including the year and allows sorting by date + (when grepping in multiple log files) without hassle. + - In get_last_url(), do not bother trying to decode URLs that do + not contain at least one '%' sign. It reduces the log noise and + a number of unnecessary memory allocations. + - In case of SOCKS5 failures, dump the socks response in the log message. + - Simplify the signal setup in main(). + - Streamline socks5_connect() slightly. + - In socks5_connect(), require a complete socks response from the server. + Previously Privoxy didn't care how much data the server response + contained as long as the first two bytes contained the expected + values. While at it, shrink the buffer size so Privoxy can't read + more than a whole socks response. + - In chat(), do not bother to generate a client request in case of + direct CONNECT requests. It will not be used anyway. + - Reduce server_last_modified()'s stack size. + - Shorten get_http_time() by using strftime(). + - Constify the known_http_methods pointers in unknown_method(). + - Constify the time_formats pointers in parse_header_time(). + - Constify the formerly_valid_actions pointers in action_used_to_be_valid(). + - Introduce a GNUMakefile MAN_PAGE variable that defaults to privoxy.1. + The Debian package uses section 8 for the man page and this + should simplify the patch. + - Deduplicate the INADDR_NONE definition for Solaris by moving it to jbsockets.h + - In block_url(), ditch the obsolete workaround for ancient Netscape versions + that supposedly couldn't properly deal with status code 403. + - Remove a useless NULL pointer check in load_trustfile(). + - Remove two useless NULL pointer checks in load_one_re_filterfile(). + - Change url_code_map[] from an array of pointers to an array of arrays + It removes an unnecessary layer of indirection and on 64bit system reduces + the size of the binary a bit. + - Fix various typos. Fixes taken from Debian's 29_typos.dpatch by Roland Rosenfeld. + - Add a dok-tidy GNUMakefile target to clean up the messy HTML + generated by the other dok targets. + - GNUisms in the GNUMakefile have been removed. + - Change the HTTP version in static responses to 1.1 + - Synced config.sub and config.guess with upstream + 2011-11-11/386c7218162c145f5f9e1ff7f558a3fbb66c37c5. + - Add a dedicated function to parse the values of toggles. Reduces duplicated + code in load_config() and provides better error handling. Invalid or missing + toggle values are now a fatal error instead of being silently ignored. + - Terminate HTML lines in static error messages with \n instead of \r\n. + - Simplify cgi_error_unknown() a bit. + - In LogPutString(), don't bother looking at pszText when not + actually logging anything. + - Change ssplit()'s fourth parameter from int to size_t. + Fixes a clang complaint. + - Add a warning that the statistics currently can't be trusted. + Mention Privoxy-Log-Parser's --statistics option as + an alternative for the time being. + - In rfc2553_connect_to(), start setting cgi->error_message on error. + - Change the expected status code returned for http://p.p/die depending + on whether or not FEATURE_GRACEFUL_TERMINATION is available. + - In cgi_die(), mark the client connection for closing. + If the client will fetch the style sheet through another connection + it gets the main thread out of the accept() state and should thus + trigger the actual shutdown. + - Add a proper CGI message for cgi_die(). + - Don't enforce a logical line length limit in read_config_line(). + - Slightly refactor server_last_modified() to remove useless gmtime*() calls. + - In get_content_type(), also recognize '.jpeg' as JPEG extension. + - Add '.png' to the list of recognized file extensions in get_content_type(). + - In block_url(), consistently use the block reason "Request blocked by Privoxy" + In two places the reason was "Request for blocked URL" which hides the + fact that the request got blocked by Privoxy and isn't necessarily + correct as the block may be due to tags. + - In listen_loop(), reload the configuration files after accepting + a new connection instead of before. + Previously the first connection that arrived after a configuration + change would still be handled with the old configuration. + - In chat()'s receive-data loop, skip a client socket check if + the socket will be written to right away anyway. This can + increase the transfer speed for unfiltered content on fast + network connections. + - The socket timeout is used for SOCKS negotiations as well which + previously couldn't timeout. + - Don't keep the client connection alive if any configuration file + changed since the time the connection came in. This is closer to + Privoxy's behaviour before keep-alive support for client connection + has been added and also less confusing in general. + - Treat all Content-Type header values containing the pattern + 'script' as a sign of text. Reported by pribog in #3134970. + +- Action file improvements: + - Moved the site-specific block pattern section below the one for the + generic patterns so for requests that are matched in both, the block + reason for the domain is shown which is usually more useful than showing + the one for the generic pattern. + - Remove -prevent-compression from the fragile alias. It's no longer + used anywhere by default and isn't known to break stuff anyway. + - Add a (disabled) section to block various Facebook tracking URLs. + Reported by Dan Stahlke in #3421764. + - Add a (disabled) section to rewrite and redirect click-tracking + URLs used on news.google.com. + Reported by Dan Stahlke in #3421755. + - Unblock linuxcounter.net/. + Reported by Dan Stahlke in #3422612. + - Block 'www91.intel.com/' which is used by Omniture. + Reported by Adam Piggott in #3167370. + - Disable the handle-as-empty-doc-returns-ok option and mark it as deprecated. + Reminded by tceverling in #2790091. + - Add ".ivwbox.de/" to the "Cross-site user tracking" section. + Reported by Nettozahler in #3172525. + - Unblock and fast-redirect ".awin1.com/.*=http://". + Reported by Adam Piggott in #3170921. + - Block "b.collective-media.net/". + - Widen the Debian popcon exception to "qa.debian.org/popcon". + Seen in Debian's 05_default_action.dpatch by Roland Rosenfeld. + - Block ".gemius.pl/" which only seems to be used for user tracking. + Reported by johnd16 in #3002731. Additional input from Lee and movax. + - Disable banners-by-size filters for '.thinkgeek.com/'. + The filter only seems to catch pictures of the inventory. + - Block requests for 'go.idmnet.bbelements.com/please/showit/'. + Reported by kacperdominik in #3372959. + - Unblock adainitiative.org/. + - Add a fast-redirects exception for '.googleusercontent.com/.*=cache'. + - Add a fast-redirects exception for webcache.googleusercontent.com/. + - Unblock http://adassier.wordpress.com/ and http://adassier.files.wordpress.com/. + +- Filter file improvements: + - Let the yahoo filter hide '.ads'. + - Let the msn filter hide overlay ads for Facebook 'likes' in search + results and elements with the id 's_notf_div'. They only seem to be + used to advertise site 'enhancements'. + - Let the js-events filter additionally disarm setInterval(). + Suggested by dg1727 in #3423775. + +- Documentation improvements: + - Clarify the effect of compiling Privoxy with zlib support. + Suggested by dg1727 in #3423782. + - Point out that the SourceForge messaging system works like a black + hole and should thus not be used to contact individual developers. + - Mention some of the problems one can experience when not explicitly + configuring an IP addresses as listen address. + - Explicitly mention that hostnames can be used instead of IP addresses + for the listen-address, that only the first address returned will be + used and what happens if the address is invalid. + Requested by Calestyo in #3302213. + +- Log message improvements: + - If only the server connection is kept alive, do not pretend to + wait for a new client request. + - Remove a superfluous log message in forget_connection(). + - In chat(), properly report missing server responses as such + instead of calling them empty. + - In forwarded_connect(), fix a log message nobody should ever see. + - Fix a log message in socks5_connect(), a failed write operation + was logged as failed read operation. + - Let load_one_actions_file() properly complain about a missing + '{' at the beginning of the file. + Simply stating that a line is invalid isn't particularly helpful. + - Do not claim to listen on a socket until Privoxy actually does. + Patch submitted by Petr Pisar #3354485 + - Prevent a duplicated LOG_LEVEL_CLF message when sending out + the "no-server-data" response. + - Also log the client socket when dropping a connection. + - Include the destination host in the 'Request ... marked for + blocking. limit-connect{...} doesn't allow CONNECT ...' message + Patch submitted by Saperski in #3296250. + - Prevent a duplicated log message if none of the resolved IP + addresses were reachable. + - In connect_to(), do not pretend to retry if forwarded-connect-retries + is zero or unset. + - When a specified user or group can't be found, put the name in + single-quotes when logging it. + - In rfc2553_connect_to(), explain getnameinfo() errors better. + - Remove a useless log message in chat(). + - When retrying to connect, also log the maximum number of connection + attempts. + - Rephrase a log message in compile_dynamic_pcrs_job_list(). + Divide the error code and its meaning with a colon. Call the pcrs + job dynamic and not the filter. Filters may contain dynamic and + non-dynamic pcrs jobs at the same time. Only mention the name of + the filter or tagger, but don't claim it's a filter when it could + be a tagger. + - In a fatal error message in load_one_actions_file(), cover both + URL and TAG patterns. + - In pcrs_strerror(), properly report unknown positive error code + values as such. Previously they were handled like 0 (no error). + - In compile_dynamic_pcrs_job_list(), also log the actual error code as + pcrs_strerror() doesn't handle all errors reported by pcre. + - Don't bother trying to continue chatting if the client didn't ask for it. + Reduces log noise a bit. + - Make two fatal error message in load_one_actions_file() more descriptive. + - In cgi_send_user_manual(), log when rejecting a file name due to '/' or '..'. + - In load_file(), log a message if opening a file failed. + The CGI error message alone isn't too helpful. + - In connection_destination_matches(), improve two log messages + to help understand why the destinations don't match. + - Rephrase a log message in serve(). Client request arrival + should be differentiated from closed client connections now. + - In serve(), log if a client connection isn't reused due to a + configuration file change. + - Let mark_server_socket_tainted() always mark the server socket tainted, + just don't talk about it in cases where it has no effect. It doesn't change + Privoxy's behaviour, but makes understanding the log file easier. + +- configure: + - Added a --disable-ipv6-support switch for platforms where support + is detected but doesn't actually work. + - Do not check for the existence of strerror() and memmove() twice + - Remove a useless test for setpgrp(2). Privoxy doesn't need it and + it can cause problems when cross-compiling. + - Rename the --disable-acl-files switch to --disable-acl-support. + Since about 2001, ACL directives are specified in the standard + config file. + - Update the URL of the 'Removing outdated PCRE version after the + next stable release' posting. The old URL stopped working after + one of SF's recent site "optimizations". Reported by Han Liu. + +- Privoxy-Regression-Test: + - Added --shuffle-tests option to increase the chances of detection race conditions. + - Added a --local-test-file option that allows to use Privoxy-Regression-Test without Privoxy. + - Added tests for missing socks4 and socks4a forwarders. + - The --privoxy-address option now works with IPv6 addresses containing brackets, too. + - Perform limited sanity checks for parameters that are supposed to have numerical values. + - Added a --sleep-time option to specify a number of seconds to + sleep between tests, defaults to 0. + - Disable the range-requests tagger for tests that break if it's enabled. + - Log messages use the ISO 8601 date format %Y-%m-%d. + - Fix spelling in two error messages. + - In the --help output, include a list of supported tests and their default levels. + - Adjust the tests to properly deal with FEATURE_TOGGLE being disabled. + +- Privoxy-Log-Parser: + - Perform limited sanity checks for command line parameters that + are supposed to have numerical values. + - Implement a --unbreak-lines-only option to try to revert MUA breakage. + - Accept and highlight: Added header: Content-Encoding: deflate + - Accept and highlight: Compressed content from 29258 to 8630 bytes. + - Accept and highlight: Client request arrived in time on socket 21. + - Highlight: Didn't receive data in time: a.fsdn.com:443 + - Accept log messages with ISO 8601 time stamps, too. + +- uagen: + - Bump generated Firefox version to 8.0. + - Only randomize the release date if the new --randomize-release-date + option is enabled. Firefox versions after 4 use a fixed date string + without meaning. + *** Version 3.0.17 Stable *** -- Fixed last-chunk-detection for responses where the content was small - enough to be read with the body, causing Privoxy to wait for the +- Fixed last-chunk-detection for responses where the body was small + enough to be read with the headers, causing Privoxy to wait for the end of the content until the server closed the connection or the request timed out. Reported by "Karsten" in #3028326. - Responses with status code 204 weren't properly detected as body-less @@ -145,7 +510,7 @@ - In log_error(), assert that ival and sval have reasonable values. There's no reason not to abort() if they don't. - Remove an incorrect cgi_error_unknown() call in a - cannnot-happen-situation in send_crunch_response(). + cannot-happen-situation in send_crunch_response(). - Clean up white-space in http_response definition and move the crunch_reason to the beginning. - Turn http_response.reason into an enum and rename it diff -Nru privoxy-3.0.17/config privoxy-3.0.19/config --- privoxy-3.0.17/config 2010-11-13 12:48:18.000000000 +0000 +++ privoxy-3.0.19/config 2011-12-26 17:04:50.000000000 +0000 @@ -1,8 +1,8 @@ -# Sample Configuration File for Privoxy v3.0.17 +# Sample Configuration File for Privoxy v3.0.19 # -# $Id: config,v 1.93 2010/11/13 12:48:18 fabiankeil Exp $ +# $Id: config,v 1.98 2011/12/26 17:04:50 fabiankeil Exp $ # -# Copyright (C) 2001-2010 Privoxy Developers http://www.privoxy.org/ +# Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ # #################################################################### # # @@ -681,13 +681,15 @@ # # Specifies: # -# The IP address and TCP port on which Privoxy will listen for +# The address and TCP port on which Privoxy will listen for # client requests. # # Type of value: # # [IP-Address]:Port # +# [Hostname]:Port +# # Default value: # # 127.0.0.1:8118 @@ -707,17 +709,56 @@ # if you want to serve requests from other machines (e.g. on your # local network) as well, you will need to override the default. # -# IPv6 addresses containing colons have to be quoted by brackets. +# You can use this statement multiple times to make Privoxy listen +# on more ports or more IP addresses. Suitable if your operating +# system does not support sharing IPv6 and IPv4 protocols on the +# same socket. +# +# If a hostname is used instead of an IP address, Privoxy will +# try to resolve it to an IP address and if there are multiple, +# use the first one returned. +# +# If the address for the hostname isn't already known on the +# system (for example because it's in /etc/hostname), this may +# result in DNS traffic. +# +# If the specified address isn't available on the system, or if +# the hostname can't be resolved, Privoxy will fail to start. +# +# IPv6 addresses containing colons have to be quoted by +# brackets. They can only be used if Privoxy has been compiled +# with IPv6 support. If you aren't sure if your version supports +# it, have a look at http://config.privoxy.org/ show-status. +# +# Some operating systems will prefer IPv6 to IPv4 addresses even if +# the system has no IPv6 connectivity which is usually not expected +# by the user. Some even rely on DNS to resolve localhost which +# mean the "localhost" address used may not actually be local. +# +# It is therefore recommended to explicitly configure the intended +# IP address instead of relying on the operating system, unless +# there's a strong reason not to. # -# If you leave out the IP address, Privoxy will bind to all IPv4 +# If you leave out the address, Privoxy will bind to all IPv4 # interfaces (addresses) on your machine and may become reachable -# from the Internet. In that case, consider using access control -# lists (ACL's, see below), and/or a firewall. +# from the Internet and/ or the local network. Be aware that +# some GNU/Linux distributions modify that behaviour without +# updating the documentation. Check for non-standard patches if +# your Privoxyversion behaves differently. +# +# If you configure Privoxyto be reachable from the network, +# consider using access control lists (ACL's, see below), and/or +# a firewall. # # If you open Privoxy to untrusted users, you will also # want to make sure that the following actions are disabled: # enable-edit-actions and enable-remote-toggle # +# With the exception noted above, listening on multiple addresses +# is currently not supported by Privoxy directly. It can be done +# on most operating systems by letting a packet filter redirect +# request for certain addresses to Privoxy, though. +# # Example: # # Suppose you are running Privoxy on a machine which has the @@ -1167,7 +1208,7 @@ # # Parent proxy specified by an IPv6 address: # -# foward / [2001:DB8::1]:8000 +# forward / [2001:DB8::1]:8000 # # # Suppose your parent proxy doesn't support IPv6: @@ -1712,17 +1753,11 @@ # max-client-connections 256 # #max-client-connections 256 -# + # # 6.9. handle-as-empty-doc-returns-ok # ==================================== # -# Note: -# -# This is a work-around for Firefox bug 492459: " Websites are no -# longer rendered if SSL requests for JavaScripts are blocked by -# a proxy. " (https:/ /bugzilla.mozilla.org/show_bug.cgi?id=492459) -# # Specifies: # # The status code Privoxy returns for pages blocked with @@ -1746,7 +1781,102 @@ # +handle-as-empty-document and a status 403(Forbidden) for all # other blocked pages. # -handle-as-empty-doc-returns-ok 1 +# Notes: +# +# This is a work-around for Firefox bug 492459: " Websites are no +# longer rendered if SSL requests for JavaScripts are blocked by a +# proxy. " (https:/ /bugzilla.mozilla.org/show_bug.cgi?id=492459) +# As the bug has been fixed for quite some time this option +# should no longer be needed and will be removed in a future +# release. Please speak up if you have a reason why the option +# should be kept around. +# +#handle-as-empty-doc-returns-ok 1 +# +# +# 1.6.10. enable-compression +# +# Specifies: +# +# Whether or not buffered content is compressed before delivery. +# +# Type of value: +# +# 0 or 1 +# +# Default value: +# +# 0 +# +# Effect if unset: +# +# Privoxy does not compress buffered content. +# +# Effect if set: +# +# Privoxy compresses buffered content before delivering it to +# the client, provided the client supports it. +# +# Notes: +# +# This directive is only supported if Privoxy has been compiled +# with FEATURE_COMPRESSION, which should not to be confused +# with FEATURE_ZLIB. +# +# Compressing buffered content is mainly useful if Privoxy and the +# client are running on different systems. If they are running on +# the same system, enabling compression is likely to slow things +# down. If you didn't measure otherwise, you should assume that +# it does and keep this option disabled. +# +# Privoxy will not compress buffered content below a certain +# length. +# +#enable-compression 1 +# +# +# 1.6.11. compression-level +# +# Specifies: +# +# The compression level that is passed to the zlib library when +# compressing buffered content. +# +# Type of value: +# +# Positive number ranging from 0 to 9. +# +# Default value: +# +# 1 +# +# Notes: +# +# Compressing the data more takes usually longer than compressing +# it less or not compressing it at all. Which level is best +# depends on the connection between Privoxy and the client. If +# you can't be bothered to benchmark it for yourself, you should +# stick with the default and keep compression disabled. +# +# If compression is disabled, the compression level is irrelevant. +# +# Examples: +# +# # Best speed (compared to the other levels) +# compression-level 1 +# +# # Best compression +# compression-level 9 +# +# # No compression. Only useful for testing as the added header +# # slightly increases the amount of data that has to be sent. +# # If your benchmark shows that using this compression level +# # is superior to using no compression at all, the benchmark +# # is likely to be flawed. +# compression-level 0 +# +# +#compression-level 1 # # # 7. WINDOWS GUI OPTIONS diff -Nru privoxy-3.0.17/config.guess privoxy-3.0.19/config.guess --- privoxy-3.0.17/config.guess 2009-06-21 19:21:11.000000000 +0000 +++ privoxy-3.0.19/config.guess 2011-11-12 12:54:35.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2008-01-23' +timestamp='2011-11-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,16 +27,16 @@ # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,8 +56,9 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -170,7 +171,7 @@ arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -180,7 +181,7 @@ fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -223,7 +224,7 @@ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -269,7 +270,10 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -295,7 +299,7 @@ echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -324,14 +328,33 @@ case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -375,23 +398,23 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -461,8 +484,8 @@ echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -475,7 +498,7 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -532,7 +555,7 @@ echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -575,52 +598,52 @@ 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -640,7 +663,7 @@ # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -711,22 +734,22 @@ exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -750,14 +773,14 @@ exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -769,13 +792,12 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -784,19 +806,22 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in + *:Interix*:*) + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -806,6 +831,9 @@ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -835,6 +863,20 @@ i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ @@ -842,7 +884,13 @@ then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) @@ -855,7 +903,21 @@ echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo frv-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo hexagon-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -866,74 +928,33 @@ m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) + mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef mips64 - #undef mips64el + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el + CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 + CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + padre:Linux:*:*) + echo sparc-unknown-linux-gnu exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level @@ -943,14 +964,17 @@ *) echo hppa-unknown-linux-gnu ;; esac exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -958,6 +982,9 @@ sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; @@ -965,71 +992,8 @@ echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both @@ -1037,11 +1001,11 @@ echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1058,7 +1022,7 @@ i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1073,7 +1037,7 @@ fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1101,10 +1065,13 @@ exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1139,8 +1106,18 @@ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1153,7 +1130,7 @@ rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1173,10 +1150,10 @@ echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1202,11 +1179,11 @@ exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1216,6 +1193,9 @@ BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1243,6 +1223,16 @@ *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} @@ -1258,6 +1248,9 @@ *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1303,13 +1296,13 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1324,6 +1317,9 @@ i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1346,11 +1342,11 @@ #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff -Nru privoxy-3.0.17/config.sub privoxy-3.0.19/config.sub --- privoxy-3.0.17/config.sub 2009-06-21 19:21:12.000000000 +0000 +++ privoxy-3.0.19/config.sub 2011-11-12 12:54:35.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2008-02-05' +timestamp='2011-11-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -32,13 +32,16 @@ # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. @@ -72,8 +75,9 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -120,8 +124,10 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -148,10 +154,13 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -166,10 +175,10 @@ os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -242,15 +251,20 @@ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -270,28 +284,42 @@ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none @@ -302,6 +330,18 @@ basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -321,19 +361,23 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -355,27 +399,32 @@ | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ | tron-* \ - | v850-* | v850e-* | vax-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -397,7 +446,7 @@ basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -443,6 +492,10 @@ basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -459,10 +512,27 @@ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -491,7 +561,7 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -530,6 +600,10 @@ basic_machine=m88k-motorola os=-sysv3 ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp @@ -703,6 +777,9 @@ basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -739,10 +816,18 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -807,6 +892,12 @@ np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -889,9 +980,10 @@ ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -985,6 +1077,9 @@ basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1041,20 +1136,8 @@ basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1124,6 +1207,9 @@ xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1132,6 +1218,10 @@ basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1170,7 +1260,7 @@ we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1217,9 +1307,12 @@ if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1240,10 +1333,11 @@ # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1252,9 +1346,10 @@ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1262,7 +1357,7 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1301,7 +1396,7 @@ -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1350,7 +1445,7 @@ -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1392,6 +1487,11 @@ -zvmoe) os=-zvmoe ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; -none) ;; *) @@ -1414,10 +1514,10 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1429,8 +1529,17 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1457,7 +1566,7 @@ m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1484,7 +1593,7 @@ *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) @@ -1589,7 +1698,7 @@ -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) diff -Nru privoxy-3.0.17/configure.in privoxy-3.0.19/configure.in --- privoxy-3.0.17/configure.in 2010-10-30 15:57:50.000000000 +0000 +++ privoxy-3.0.19/configure.in 2011-12-26 17:03:31.000000000 +0000 @@ -1,38 +1,38 @@ dnl Process this file with autoconf to produce a configure script. -dnl -dnl $Id: configure.in,v 1.147 2010/10/30 15:57:50 fabiankeil Exp $ -dnl +dnl +dnl $Id: configure.in,v 1.166 2011/12/26 17:03:31 fabiankeil Exp $ +dnl dnl Written by and Copyright (C) 2001-2010 the dnl Privoxy team. http://www.privoxy.org/ dnl dnl Based on the Internet Junkbuster originally written -dnl by and Copyright (C) 1997 Anonymous Coders and +dnl by and Copyright (C) 1997 Anonymous Coders and dnl Junkbusters Corporation. http://www.junkbusters.com dnl -dnl This program is free software; you can redistribute it +dnl This program is free software; you can redistribute it dnl and/or modify it under the terms of the GNU General dnl Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at dnl your option) any later version. -dnl +dnl dnl This program is distributed in the hope that it will dnl be useful, but WITHOUT ANY WARRANTY; without even the dnl implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. See the GNU General Public dnl License for more details. -dnl +dnl dnl The GNU General Public License should be included with dnl this file. If not, you can view it at dnl http://www.gnu.org/copyleft/gpl.html dnl or write to the Free Software Foundation, Inc., 59 dnl Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl +dnl dnl ================================================================= dnl AutoConf Initialization dnl ================================================================= -AC_REVISION($Revision: 1.147 $) +AC_REVISION($Revision: 1.166 $) AC_INIT(jcc.c) if test ! -f config.h.in; then @@ -44,7 +44,7 @@ else autoheader fi -fi +fi AC_CONFIG_HEADER([config.h]) AC_CANONICAL_HOST @@ -52,13 +52,13 @@ dodk=auto DKPREFIX=none AC_ARG_WITH(docbook, dnl - --with-docbook=[[yes|no|directory]] - Enable docbook documentation creation + --with-docbook=[[yes|no|directory]] + Enable docbook documentation creation (default = yes, for gnu and linux),[dnl case "$with_docbook" in yes) dodk=yes;; no) dodk=no;; -*) +*) dodk=yes DKPREFIX=$withval ;; @@ -78,12 +78,13 @@ VERSION_MAJOR=3 VERSION_MINOR=0 -VERSION_POINT=17 +VERSION_POINT=19 CODE_STATUS="stable" -dnl CODE_STATUS can be "alpha", "beta", or "stable", and will be -dnl used for CGI output. Set version to 0.0.0 and status to "UNRELEASED" -dnl whenever CVS in a stable branch differs from the last release. +dnl CODE_STATUS can be "alpha", "beta", "stable" or "UNRELEASED", +dnl and will be used for CGI output. Increment version number and +dnl set status to "UNRELEASED" whenever CVS differs from the last +dnl release and no new release is near. dnl ================================================================= dnl Substitute the version numbers @@ -124,7 +125,7 @@ AC_SUBST(BGROUPS) dnl ================================================================= -dnl debug, gcc and gdb support +dnl debug, gcc and gdb support dnl ================================================================= AC_ARG_WITH(debug, @@ -202,7 +203,7 @@ AC_MSG_CHECKING([for group]) AC_ARG_WITH(group, [ --with-group=privoxy Set group for privoxy], - [ + [ if test "x$withval" != "xyes"; then if test $BGROUPS = no ; then AC_MSG_ERROR(There is no 'groups' program on this system) @@ -241,7 +242,7 @@ dnl ================================================================= dnl additional gcc flags dnl ================================================================= -dnl +dnl if test "$GCC"; then if test "$host" != "powerpc-unknown-amigaos"; then CFLAGS="-pipe $CFLAGS" @@ -259,7 +260,7 @@ dnl into Cygwin or MinGW32 modes. Depending on the mode selected, dnl the compiler will use completely different sets of library dnl and include files. -dnl +dnl dnl ================================================================= AC_MINGW32 @@ -315,7 +316,7 @@ fi AC_SUBST(WIN_ONLY) -dnl Checking which text html browser we have avaliable +dnl Checking which text html browser we have available if test $dodk != no; then AC_CHECK_PROGS(WDUMP,w3m lynx links,false) if test "$WDUMP" = false; then @@ -323,7 +324,7 @@ fi if test $DB2HTML = false; then dnl We need to clean the variable, otherwise AC_CHECK_PROGS - dnl will fail + dnl will fail DB2HTML="" AC_CHECK_PROGS(DB2HTML,db2html docbook2html,false) fi @@ -429,7 +430,7 @@ [if test $enableval = no; then # Disable pthreads if test $have_pthread = yes; then - AC_MSG_WARN([pthreads seem to be available but you are using --disable-pthread.]) + AC_MSG_WARN([pthreads seem to be available but you are using --disable-pthread.]) AC_MSG_WARN([This is almost always a mistake and can render Privoxy unacceptable slow.]) fi have_pthread=no @@ -647,10 +648,10 @@ dnl ================================================================= dnl Mac OSX specific dnl ================================================================= - + case "$host" in *-apple-darwin*) SPECIAL_CFLAGS="-Dunix" -;; +;; esac dnl ================================================================= @@ -700,21 +701,23 @@ AC_CHECK_HEADERS([OS.h arpa/inet.h errno.h fcntl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h sys/wait.h unistd.h]) dnl Checks for library functions. -dnl AC_TYPE_SIGNAL -dnl AC_CHECK_FUNC(strstr) -dnl bcopy and memmove are for PCRE -AC_CHECK_FUNCS([strerror bcopy memmove]) +dnl bcopy is for PCRE +AC_CHECK_FUNCS([bcopy]) AC_PROG_GCC_TRADITIONAL -dnl uncommenting does not work for swa. suse linux -dnl AC_FUNC_MALLOC -AC_FUNC_SETPGRP AC_TYPE_SIGNAL -dnl uncommenting does not work for swa. suse linux -dnl AC_FUNC_STAT AC_CHECK_FUNCS([access atexit getcwd gethostbyaddr gethostbyaddr_r gethostbyname gethostbyname_r gettimeofday inet_ntoa localtime_r memchr memmove memset poll putenv random regcomp select setlocale snprintf socket strchr strdup strerror strftime strlcat strlcpy strptime strstr strtoul timegm tzset]) dnl Checks for RFC 2553 resolver and socket functions -if test $target_type = mingw; then +AC_ARG_ENABLE(ipv6-support, +[ --disable-ipv6-support Disable IPv6 support and other RFC-2554-related improvements], +[if test $enableval = yes; then + enable_ipv6_support=yes +fi], enable_ipv6_support=yes) + +if test $enable_ipv6_support != yes; then + AC_MSG_WARN([Skipping checks for IPv6 support and other RFC-2554-related improvements. + Due to lock contention, this may result in slower DNS resolution for IPv4 setups, too.]) +elif test $target_type = mingw; then AC_CHECK_LIB(ws2_32, main) AC_MSG_CHECKING(getaddrinfo in ws2_32) @@ -771,7 +774,7 @@ ], [have_pcre=no]) ]) ], [have_pcre=no]) - + AC_CHECK_LIB(pcreposix, regcomp, [ AC_CHECK_HEADER(pcreposix.h, [ AC_EGREP_HEADER(pcreposix_regerror, pcreposix.h, [AC_MSG_WARN([[pcreposix old version installed]]); have_pcreposix=no], [have_pcreposix=yes]) @@ -780,7 +783,7 @@ AC_EGREP_HEADER(pcreposix_regerror, pcre/pcreposix.h, [AC_MSG_WARN([[pcreposix old version installed]]); have_pcreposix=no], [have_pcreposix=yes]; [AC_DEFINE(PCREPOSIX_H_IN_SUBDIR)]) ], [have_pcreposix=no]) ]) -], [have_pcreposix=no], -lpcre) +], [have_pcreposix=no], -lpcre) dnl ================================================================ dnl libpcrs is temporarily disabled. @@ -835,15 +838,15 @@ fi],) AC_ARG_ENABLE(image-blocking, -[ --disable-image-blocking Don't try to figure out whether a request is +[ --disable-image-blocking Don't try to figure out whether a request is for an image or HTML - assume HTML.], [if test $enableval = yes; then AC_DEFINE(FEATURE_IMAGE_BLOCKING) fi], AC_DEFINE(FEATURE_IMAGE_BLOCKING)) -AC_ARG_ENABLE(acl-files, -[ --disable-acl-files Prevents the use of ACL files to control access to +AC_ARG_ENABLE(acl-support, +[ --disable-acl-support Prevents the use of ACLs to control access to Privoxy by IP address.], [if test $enableval = yes; then AC_DEFINE(FEATURE_ACL) @@ -925,12 +928,25 @@ AC_CHECK_LIB(z, zlibVersion, [have_zlib="yes"], [have_zlib="no"]) if test $have_zlib = "yes"; then LIBS="$LIBS -lz" - AC_DEFINE(FEATURE_ZLIB,1,[Define to 1 to use compression through the zlib library.]) + AC_DEFINE(FEATURE_ZLIB,1,[Define to 1 to use zlib to decompress data before filtering.]) else AC_MSG_WARN([No zlib found. Privoxy will not be able to filter compressed content. This may become a fatal error in the future.]) - fi + fi +fi + +AC_ARG_ENABLE(compression, +[ --enable-compression Allow Privoxy to compress buffered content if the client supports it. Requires zlib support.], +[enableval2=$enableval], +[enableval2=no]) +if test $enableval2 = yes; then + if test $have_zlib = "yes"; then + echo Enabling compression support. + AC_DEFINE(FEATURE_COMPRESSION,1,[Define to 1 to use compression through the zlib library.]) + else + AC_MSG_WARN([No zlib found. Privoxy will not be able to (re-)compressed buffered content.]) + fi fi @@ -944,8 +960,8 @@ STATIC_PCRE_ONLY=# LIBS="$LIBS -lpcre -lpcreposix" else - AC_MSG_WARN([You are using the static PCRE code which is scheduled for removal, for details see: - https://sourceforge.net/mailarchive/message.php?msg_id=20080511195555.2dc6cfdc%40fabiankeil.de]) + AC_MSG_WARN([You are using the static PCRE code which is out of date and scheduled for removal, for details see: + http://sourceforge.net/mailarchive/forum.php?thread_name=20080511195555.2dc6cfdc%40fabiankeil.de&forum_name=ijbswa-developers]) pcre_dyn=no AC_DEFINE(STATIC_PCRE) STATIC_PCRE_ONLY= @@ -983,7 +999,7 @@ dnl Final cleanup and output dnl ================================================================= -dnl Remove the SPECIAL_CFLAGS stuff from CFLAGS, and add it seperately +dnl Remove the SPECIAL_CFLAGS stuff from CFLAGS, and add it separately dnl in the Makefile CFLAGS=$old_CFLAGS_nospecial AC_SUBST(SPECIAL_CFLAGS) diff -Nru privoxy-3.0.17/cygwin.h privoxy-3.0.19/cygwin.h --- privoxy-3.0.17/cygwin.h 2009-06-21 19:21:12.000000000 +0000 +++ privoxy-3.0.19/cygwin.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef CYGWIN_H_INCLUDED #define CYGWIN_H_INCLUDED -#define CYGWIN_H_VERSION "$Id: cygwin.h,v 1.7 2009/05/16 13:27:20 fabiankeil Exp $" +#define CYGWIN_H_VERSION "$Id: cygwin.h,v 1.8 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cygwin.h,v $ @@ -13,10 +13,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/deanimate.c privoxy-3.0.19/deanimate.c --- privoxy-3.0.17/deanimate.c 2009-06-21 19:21:12.000000000 +0000 +++ privoxy-3.0.19/deanimate.c 2011-09-04 11:10:56.000000000 +0000 @@ -1,4 +1,4 @@ -const char deanimate_rcs[] = "$Id: deanimate.c,v 1.20 2009/05/16 13:27:20 fabiankeil Exp $"; +const char deanimate_rcs[] = "$Id: deanimate.c,v 1.21 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/deanimate.c,v $ @@ -6,7 +6,7 @@ * Purpose : Declares functions to manipulate binary images on the * fly. High-level functions include: * - Deanimation of GIF images - * + * * Functions declared include: gif_deanimate, buf_free, * buf_copy, buf_getbyte, gif_skip_data_block * and gif_extract_image @@ -19,7 +19,7 @@ * and ideas from the Image::DeAnim Perl module by * Ken MacFarlane, * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -53,7 +53,7 @@ const char deanimate_h_rcs[] = DEANIMATE_H_VERSION; /********************************************************************* - * + * * Function : buf_free * * Description : Safely frees a struct binbuffer @@ -79,7 +79,7 @@ /********************************************************************* - * + * * Function : buf_extend * * Description : Ensure that a given binbuffer can hold a given amount @@ -90,7 +90,7 @@ * Parameters : * 1 : buf = Pointer to the binbuffer * 2 : length = Desired minimum size - * + * * * Returns : 0 on success, 1 on failure. * @@ -121,7 +121,7 @@ /********************************************************************* - * + * * Function : buf_copy * * Description : Safely copies a given amount of bytes from one @@ -142,7 +142,7 @@ /* * Sanity check: Can't copy more data than we have */ - if (src->offset + length > src->size) + if (src->offset + length > src->size) { return 1; } @@ -150,7 +150,7 @@ /* * Ensure that dst can hold the new data */ - if (buf_extend(dst, length)) + if (buf_extend(dst, length)) { return 1; } @@ -169,7 +169,7 @@ /********************************************************************* - * + * * Function : buf_getbyte * * Description : Safely gets a byte from a given binbuffer at a @@ -197,7 +197,7 @@ /********************************************************************* - * + * * Function : gif_skip_data_block * * Description : Safely advances the offset of a given struct binbuffer @@ -215,7 +215,7 @@ { unsigned char c; - /* + /* * Data blocks are sequences of chunks, which are headed * by a one-byte length field, with the last chunk having * zero length. @@ -236,12 +236,12 @@ /********************************************************************* - * + * * Function : gif_extract_image * * Description : Safely extracts an image data block from a given * struct binbuffer that contains a GIF image and whose - * offset is positioned at the start of a data block + * offset is positioned at the start of a data block * into a given destination binbuffer. * * Parameters : @@ -279,7 +279,7 @@ if (buf_copy(src, dst, (size_t)map_length)) { return 1; - } + } } if (buf_copy(src, dst, 1)) return 1; @@ -304,7 +304,7 @@ } /********************************************************************* - * + * * Function : gif_deanimate * * Description : Deanimate a given GIF image, i.e. given a GIF with @@ -336,9 +336,9 @@ c = buf_getbyte(src, 10); /* - * Check & copy GIF header + * Check & copy GIF header */ - if (strncmp(src->buffer, "GIF89a", 6) && strncmp(src->buffer, "GIF87a", 6)) + if (strncmp(src->buffer, "GIF89a", 6) && strncmp(src->buffer, "GIF87a", 6)) { return 1; } @@ -390,7 +390,7 @@ case 0x3b: goto write; - /* + /* * Image block: Extract to current image buffer. */ case 0x2c: @@ -450,13 +450,13 @@ */ default: goto failed; - + } } /* -END- while src */ /* * Either we got here by goto, or because the GIF is - * bogus and EOF was reached before an end-of-gif marker + * bogus and EOF was reached before an end-of-gif marker * was found. */ diff -Nru privoxy-3.0.17/deanimate.h privoxy-3.0.19/deanimate.h --- privoxy-3.0.17/deanimate.h 2009-06-21 19:21:12.000000000 +0000 +++ privoxy-3.0.19/deanimate.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef DEANIMATE_H_INCLUDED #define DEANIMATE_H_INCLUDED -#define DEANIMATE_H_VERSION "$Id: deanimate.h,v 1.13 2009/05/16 13:27:20 fabiankeil Exp $" +#define DEANIMATE_H_VERSION "$Id: deanimate.h,v 1.14 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/deanimate.h,v $ @@ -8,9 +8,9 @@ * Purpose : Declares functions to manipulate binary images on the * fly. High-level functions include: * - Deanimation of GIF images - * + * * Functions declared include: gif_deanimate and buf_free. - * + * * * Copyright : Written by and Copyright (C) 2001 - 2004 by the the * SourceForge Privoxy team. http://www.privoxy.org/ @@ -19,10 +19,10 @@ * Ken MacFarlane, * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -64,7 +64,7 @@ extern int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_image); extern void buf_free(struct binbuffer *buf); -/* +/* * Revision control strings from this header and associated .c file */ extern const char deanimate_rcs[]; diff -Nru privoxy-3.0.17/debian/changelog privoxy-3.0.19/debian/changelog --- privoxy-3.0.17/debian/changelog 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/changelog 2012-01-10 04:01:45.000000000 +0000 @@ -1,3 +1,26 @@ +privoxy (3.0.19-1~ppa1~oneiric1) oneiric; urgency=low + + * Backport to Oneiric. + + -- Nicola Ferralis Mon, 09 Jan 2012 22:49:51 -0500 + +privoxy (3.0.19-1) unstable; urgency=low + + * New upstream version 3.0.19-stable. + * Adapt all patches to new version. + + -- Roland Rosenfeld Tue, 27 Dec 2011 11:19:53 +0100 + +privoxy (3.0.18-1) unstable; urgency=low + + * New upstream version 3.0.18-stable. + * Adapt all patches to new version. + * Add build-targets build-arch and build-indep. + * Upgrade to Standards-Version 3.9.2 (no changes). + * 29_typo: most old typos are fixed now, but lintian found new ones. + + -- Roland Rosenfeld Mon, 21 Nov 2011 19:29:06 +0100 + privoxy (3.0.17-1) unstable; urgency=low * New upstream version 3.0.17-stable (Closes: #611016). diff -Nru privoxy-3.0.17/debian/control privoxy-3.0.19/debian/control --- privoxy-3.0.17/debian/control 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/control 2012-01-10 04:01:45.000000000 +0000 @@ -5,7 +5,7 @@ Build-Depends: debhelper (>= 5.0.0), autoconf, autotools-dev, libpcre3-dev, jade, docbook-dsssl, docbook, w3m, sp, sgmlspl, groff, man2html, dpatch, zlib1g-dev -Standards-Version: 3.9.1 +Standards-Version: 3.9.2 Homepage: http://www.privoxy.org/ Package: privoxy diff -Nru privoxy-3.0.17/debian/patches/05_defaut_action.dpatch privoxy-3.0.19/debian/patches/05_defaut_action.dpatch --- privoxy-3.0.17/debian/patches/05_defaut_action.dpatch 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/patches/05_defaut_action.dpatch 2012-01-10 04:01:45.000000000 +0000 @@ -8,16 +8,7 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/default.action.master privoxy/default.action.master --- privoxy~/default.action.master +++ privoxy/default.action.master -@@ -1704,7 +1704,7 @@ - # URL = http://kb.adobe.com/selfservice/viewContent.do?externalId=kb402747&sliceId=1 - .adobe.com - # URL = http://qa.debian.org/popcon.php --qa.debian.org/popcon\.php -+qa.debian.org/popcon - #MASTER# REMARKS: Support Requests item #2432535 2008-12-16 - # URL = http://www.mta.info/bandt/traffic/advmain.htm - .mta.info/.*advmain.htm$ -@@ -2225,6 +2225,9 @@ +@@ -2259,6 +2259,9 @@ #MASTER# REMARKS: Exclude per Debian bug report #377843 # URL = http://blogs.msdn.com/wga/archive/2006/07/16/667063.aspx blogs.msdn.com @@ -27,7 +18,7 @@ {-filter{unsolicited-popups}} # Sticky Actions = -filter{unsolicited-popups} -@@ -2275,6 +2278,11 @@ +@@ -2312,6 +2315,11 @@ {+filter{tiny-textforms}} .sourceforge.net/tracker diff -Nru privoxy-3.0.17/debian/patches/14_config.dpatch privoxy-3.0.19/debian/patches/14_config.dpatch --- privoxy-3.0.17/debian/patches/14_config.dpatch 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/patches/14_config.dpatch 2012-01-10 04:01:45.000000000 +0000 @@ -9,13 +9,13 @@ --- privoxy~/config +++ privoxy/config @@ -1,6 +1,6 @@ --# Sample Configuration File for Privoxy v3.0.17 +-# Sample Configuration File for Privoxy v3.0.19 +# Sample Configuration File for Privoxy # --# $Id: config,v 1.93 2010/11/13 12:48:18 fabiankeil Exp $ +-# $Id: config,v 1.98 2011/12/26 17:04:50 fabiankeil Exp $ +# Id: config,v # - # Copyright (C) 2001-2010 Privoxy Developers http://www.privoxy.org/ + # Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ # @@ -128,7 +128,7 @@ # If set, this option should be the first option in the config diff -Nru privoxy-3.0.17/debian/patches/15_mansection8.dpatch privoxy-3.0.19/debian/patches/15_mansection8.dpatch --- privoxy-3.0.17/debian/patches/15_mansection8.dpatch 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/patches/15_mansection8.dpatch 2012-01-10 04:01:45.000000000 +0000 @@ -8,88 +8,22 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/GNUmakefile.in privoxy/GNUmakefile.in --- privoxy~/GNUmakefile.in +++ privoxy/GNUmakefile.in -@@ -175,7 +175,7 @@ - DOC_FILES = AUTHORS LICENSE README ChangeLog INSTALL \ - `find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \ - `find doc/webserver/ -name "*.css"` \ -- privoxy.1 -+ privoxy.8 - - ############################################################################# - # Filenames and libraries -@@ -457,7 +457,7 @@ - $(RM) doc/man/* doc/webserver/man-page/*.html - ifneq ($(MAN2HTML),false) - $(ECHO) "Privoxy Man page

NAME

" > doc/webserver/man-page/privoxy-man-page.html -- man ./privoxy.1 | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html -+ man ./privoxy.8 | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html - $(ECHO) "" >> doc/webserver/man-page/privoxy-man-page.html - else - $(MAKE) groff2html -@@ -469,19 +469,19 @@ - man: dok-release - mkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\ - nsgmls ../privoxy-man-page.sgml | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\ -- perl -pi.bak -e 's/ //; s/\[ /\[/g' privoxy.1 ;\ -- perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" privoxy.1; \ -- perl -pi.bak -e "s/ö/\\\\[:o]/g" privoxy.1; \ -- perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' privoxy.1; \ -- perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' privoxy.1; \ -- perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' privoxy.1; \ -- $(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.1 ../../../privoxy.1 -+ perl -pi.bak -e 's/ //; s/\[ /\[/g' privoxy.8 ;\ -+ perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" privoxy.8; \ -+ perl -pi.bak -e "s/ö/\\\\[:o]/g" privoxy.8; \ -+ perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' privoxy.8; \ -+ perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' privoxy.8; \ -+ perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' privoxy.8; \ -+ $(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.8 ../../../privoxy.8 - - # For those with man2html ala RH7s. - man2html: - mkdir -p doc/webserver/man-page - ifneq ($(MAN2HTML),false) -- $(MAN2HTML) privoxy.1 |grep -v "^Content-type" > tmp.html -+ $(MAN2HTML) privoxy.8 |grep -v "^Content-type" > tmp.html - $(PERL) -pi.bak -e 's///; s//man2html/' tmp.html - $(PERL) -pi.bak -e 's/(<\/HEAD>)/<\/HEAD>/' tmp.html - # Twice because my version of man2html is pulling in commas and periods in URLs. -@@ -497,7 +497,7 @@ - - # Otherwise we get plain groff conversion. - groff2html: -- $(G2H_CMD) ./privoxy.1 | $(SED) -e 's@@@' > doc/webserver/man-page/privoxy-man-page.html -+ $(G2H_CMD) ./privoxy.8 | $(SED) -e 's@@@' > doc/webserver/man-page/privoxy-man-page.html - - - # readme page and INSTALL file -@@ -838,8 +838,8 @@ - $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC/user-manual;\ - fi - @# Not all platforms support gzipped man pages. -- @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/privoxy.1 -- -$(INSTALL) $(INSTALL_T) privoxy.1 $(DESTDIR)$(MAN_DEST)/privoxy.1 -+ @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/privoxy.8 -+ -$(INSTALL) $(INSTALL_T) privoxy.8 $(DESTDIR)$(MAN_DEST)/privoxy.8 - - @# Change the config file default directories according to the configured ones - @$(ECHO) Rewriting config for this installation -@@ -987,7 +987,7 @@ - - @# man page and docs - @$(ECHO) Removing $(PROGRAM) docs -- -$(RM) $(DESTDIR)$(MAN_DEST)/privoxy.1* -+ -$(RM) $(DESTDIR)$(MAN_DEST)/privoxy.8* - -$(RM) -r $(DESTDIR)$(DOC_DEST) || $(RM) -r $(DESTDIR)$(prefix)/doc/privoxy - - @# Log and pidfile +@@ -60,7 +60,7 @@ + SBIN_DEST = @sbindir@ + MAN_DIR = @mandir@ + MAN_DEST = $(MAN_DIR)/man1 +-MAN_PAGE = privoxy.1 ++MAN_PAGE = privoxy.8 + SHARE_DEST = @datadir@ + DOC_DEST = $(SHARE_DEST)/doc/privoxy + VAR_DEST = @localstatedir@ diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/doc/source/privoxy-man-page.sgml privoxy/doc/source/privoxy-man-page.sgml --- privoxy~/doc/source/privoxy-man-page.sgml +++ privoxy/doc/source/privoxy-man-page.sgml @@ -58,7 +58,7 @@ - privoxy + privoxy - 1 + 8 diff -Nru privoxy-3.0.17/debian/patches/17_502_no_such_domain.dpatch privoxy-3.0.19/debian/patches/17_502_no_such_domain.dpatch --- privoxy-3.0.17/debian/patches/17_502_no_such_domain.dpatch 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/patches/17_502_no_such_domain.dpatch 2012-01-10 04:01:45.000000000 +0000 @@ -25,6 +25,6 @@ - 404 + 502 - + diff -Nru privoxy-3.0.17/debian/patches/27_remove_nsl.dpatch privoxy-3.0.19/debian/patches/27_remove_nsl.dpatch --- privoxy-3.0.17/debian/patches/27_remove_nsl.dpatch 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/patches/27_remove_nsl.dpatch 2012-01-10 04:01:45.000000000 +0000 @@ -8,7 +8,7 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/configure.in privoxy/configure.in --- privoxy~/configure.in +++ privoxy/configure.in -@@ -468,7 +468,7 @@ +@@ -469,7 +469,7 @@ dnl ================================================================= dnl Next line needed to find the gethost*_r functions on Solaris diff -Nru privoxy-3.0.17/debian/patches/28_listen_localhost.dpatch privoxy-3.0.19/debian/patches/28_listen_localhost.dpatch --- privoxy-3.0.17/debian/patches/28_listen_localhost.dpatch 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/patches/28_listen_localhost.dpatch 2012-01-10 04:01:45.000000000 +0000 @@ -10,7 +10,7 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/config privoxy/config --- privoxy~/config +++ privoxy/config -@@ -732,7 +732,7 @@ +@@ -773,7 +773,7 @@ # # listen-address [::1]:8118 # diff -Nru privoxy-3.0.17/debian/patches/29_typos.dpatch privoxy-3.0.19/debian/patches/29_typos.dpatch --- privoxy-3.0.17/debian/patches/29_typos.dpatch 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/patches/29_typos.dpatch 2012-01-10 04:01:45.000000000 +0000 @@ -5,110 +5,24 @@ ## DP: fix some common typos: lenght -> length, reenable -> re-enable @DPATCH@ -diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/cgiedit.c privoxy/cgiedit.c ---- privoxy~/cgiedit.c -+++ privoxy/cgiedit.c -@@ -1734,7 +1734,7 @@ - { - log_error(LOG_LEVEL_INFO, - "Timestamp mismatch limit reached, turning CGI editor off. " -- "Reload the configuration file to reenable it."); -+ "Reload the configuration file to re-enable it."); - csp->config->feature_flags &= ~RUNTIME_FEATURE_CGI_EDIT_ACTIONS; - } - } -@@ -2882,7 +2882,7 @@ - * browsers (BR #1570678). - * - * The config option split-large-forms works around this browser -- * bug (HTTP has no URL lenght limitation) by deviding the action -+ * bug (HTTP has no URL length limitation) by deviding the action - * list form into multiple smaller ones. It means the URLs are shorter - * and work in broken browsers as well, but the user can no longer change - * all actions with one submit. -diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/jcc.c privoxy/jcc.c ---- privoxy~/jcc.c -+++ privoxy/jcc.c -@@ -2388,7 +2388,7 @@ - if (csp->content_length == 0) - { - /* -- * If Privoxy didn't recalculate the Content-Lenght, -+ * If Privoxy didn't recalculate the Content-Length, - * byte_count is still correct. - */ - csp->content_length = byte_count; -diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/list.c privoxy/list.c ---- privoxy~/list.c -+++ privoxy/list.c -@@ -496,7 +496,7 @@ - assert(list_is_valid(the_list)); - - /* -- * Calculate the lenght of the final text. -+ * Calculate the length of the final text. - * '2' because of the '\r\n' at the end of - * each string and at the end of the text. - */ -diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/loaders.c privoxy/loaders.c ---- privoxy~/loaders.c -+++ privoxy/loaders.c -@@ -765,7 +765,7 @@ - if (strlen(buf2) + 1U > buflen) - { - log_error(LOG_LEVEL_FATAL, -- "Max line limit reached. Linenumber: %u. Lenght: %u. Max lenght: %u.", -+ "Max line limit reached. Linenumber: %u. Length: %u. Max length: %u.", - *linenum, strlen(buf2), buflen-1); - } - strlcpy(buf, buf2, buflen); -diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/parsers.c privoxy/parsers.c ---- privoxy~/parsers.c -+++ privoxy/parsers.c -@@ -4159,7 +4159,7 @@ - const char *host, const int parameter_conditional_block) - { - char *referer = strdup(*header); -- const size_t hostlenght = strlen(host); -+ const size_t hostlength = strlen(host); - const char *referer_url = NULL; - - if (NULL == referer) -@@ -4169,14 +4169,14 @@ - } - - /* referer begins with 'Referer: http[s]://' */ -- if ((hostlenght+17) < strlen(referer)) -+ if ((hostlength+17) < strlen(referer)) - { - /* - * Shorten referer to make sure the referer is blocked - * if www.example.org/www.example.com-shall-see-the-referer/ - * links to www.example.com/ - */ -- referer[hostlenght+17] = '\0'; -+ referer[hostlength+17] = '\0'; - } - referer_url = strstr(referer, "http://"); - if ((NULL == referer_url) || (NULL == strstr(referer_url, host))) -diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/project.h privoxy/project.h ---- privoxy~/project.h -+++ privoxy/project.h -@@ -765,7 +765,7 @@ - #define CSP_FLAG_SERVER_CONTENT_LENGTH_SET 0x00002000U - - /** -- * Flag for csp->flags: Set if we know the content lenght, -+ * Flag for csp->flags: Set if we know the content length, - * either because the server set it, or we figured it out - * on our own. - */ +diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/cgi.c privoxy/cgi.c +--- privoxy~/cgi.c ++++ privoxy/cgi.c +@@ -2145,7 +2145,7 @@ + if (!err) err = map(exports, "time", 1, html_encode(buf), 0); + if (!err) err = map(exports, "my-ip-address", 1, html_encode(ip_address ? ip_address : "unknown"), 0); + freez(ip_address); +- if (!err) err = map(exports, "my-port", 1, html_encode(port ? port : "unkown"), 0); ++ if (!err) err = map(exports, "my-port", 1, html_encode(port ? port : "unknown"), 0); + freez(port); + if (!err) err = map(exports, "my-hostname", 1, html_encode(hostname ? hostname : "unknown"), 0); + freez(hostname); diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/tools/privoxy-log-parser.pl privoxy/tools/privoxy-log-parser.pl --- privoxy~/tools/privoxy-log-parser.pl +++ privoxy/tools/privoxy-log-parser.pl -@@ -2443,7 +2443,7 @@ - they very well might be. Also note that the results are pretty much guaranteed - to be incorrect if Privoxy and Privoxy-Log-Parser aren't in sync. +@@ -2518,7 +2518,7 @@ + Doesn't do anything else, so you probably want to pipe the output into + B again. -[B<--url-statistics-threshold>] Only show the request count for a ressource +[B<--url-statistics-threshold>] Only show the request count for a resource diff -Nru privoxy-3.0.17/debian/patches/32_bind_fixup.dpatch privoxy-3.0.19/debian/patches/32_bind_fixup.dpatch --- privoxy-3.0.17/debian/patches/32_bind_fixup.dpatch 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/patches/32_bind_fixup.dpatch 2012-01-10 04:01:45.000000000 +0000 @@ -8,7 +8,7 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' privoxy~/jbsockets.c privoxy/jbsockets.c --- privoxy~/jbsockets.c +++ privoxy/jbsockets.c -@@ -701,20 +701,7 @@ +@@ -757,20 +757,7 @@ } memset(&hints, 0, sizeof(struct addrinfo)); @@ -29,4 +29,4 @@ + hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; - #ifdef AI_ADDRCONFIG + hints.ai_protocol = 0; /* Really any stream protocol or TCP only */ diff -Nru privoxy-3.0.17/debian/rules privoxy-3.0.19/debian/rules --- privoxy-3.0.17/debian/rules 2012-01-10 04:01:44.000000000 +0000 +++ privoxy-3.0.19/debian/rules 2012-01-10 04:01:45.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/make -f # -# (C) 2002-2008 Roland Rosenfeld , based on +# (C) 2002-2011 Roland Rosenfeld , based on # Sample debian/rules that uses debhelper. # This file is public domain software, originally written by Joey Hess. @@ -24,7 +24,9 @@ OPTIMIZE=-O2 endif -build: build-stamp +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp build-stamp: patch-stamp dh_testdir diff -Nru privoxy-3.0.17/default.action.master privoxy-3.0.19/default.action.master --- privoxy-3.0.17/default.action.master 2010-11-06 10:47:59.000000000 +0000 +++ privoxy-3.0.19/default.action.master 2011-10-16 13:13:50.000000000 +0000 @@ -11,7 +11,7 @@ # # File : $Source: /cvsroot/ijbswa/current/default.action.master,v $ # -# $Id: default.action.master,v 1.227 2010/11/06 10:47:59 fabiankeil Exp $ +# $Id: default.action.master,v 1.242 2011/10/16 13:13:50 fabiankeil Exp $ # # Requires : This version requires Privoxy v3.0.11 or later due to # syntax changes. @@ -545,7 +545,7 @@ # These aliases define combinations of actions # that are useful for certain types of sites: # -fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referer -prevent-compression +fragile = -block -crunch-all-cookies -filter -fast-redirects -hide-referer shop = -crunch-all-cookies allow-popups # Your favourite blend of filters: @@ -701,6 +701,8 @@ #MASTER# REMARKS: We still like tor # URL = http://metrics.torproject.org/consensus-graphs.html metrics.torproject.org/ +# URL = http://linuxcounter.net/ +linuxcounter.net/ ############################################################################# # Generic block patterns by path: @@ -768,6 +770,141 @@ # URL = http://support.apple.com/downloads/DL985/en_US/RemoteDesktopAdmin332.dmg /.*desktopadmin + +#---------------------------------------------------------------------------- +# Misc Web-bugs, JS and just plain Junk. Images here aren't normal images. +#---------------------------------------------------------------------------- +{+block{Might be a web-bug.} +handle-as-empty-document -handle-as-image} +#MASTER# REMARKS: signature for user tracking nytimes, cnn.com,latimes.com and many others. 10/06/06 +/b/ss/.+ +#MASTER# BLOCK-REFERRER: http://www.thesun.co.uk/article/0,,11071-10784,00.html +#MASTER# REMARKS: widespread hitbox signature 10/06/06 +/HG\?hc= +#MASTER# BLOCK-REFERRER: http://macaddict.com 10/06/06 +.visistat.com +#MASTER# REMARKS: See for user tracking. +#MASTER# REMARKS: There is a ssl.google-analytics as well. +.google-analytics./ +#MASTER# REMARKS: Below Moved here from -handle-as-image 10/16/06 ########## +#MASTER# BLOCK-REFERRER: http://forums2.gardenweb.com/forums/orchids/ 09/25/06 +#MASTER# REMARKS: Mostly JS and plain text stuff +.overture. +#MASTER# PROBLEM-URL: http://www.linuxtoday.com/ +#MASTER# REMARKS: /adi has HTML snipplets for use in IFRAMEs 10/15/06 +.doubleclick.net/adi +.doubleclick.net/(.*/)?adj/ +#MASTER# PROBLEM-URL: http://maps.yahoo.com/ +#MASTER# REMARKS: /AVE/iview has HTML snipplets for use in IFRAMEs 10/15/06 +view.atdmt.com/(.*/)?iview/ +#MASTER# REMARKS: Above Moved here from -handle-as-image 10/16/06 ########## +#MASTER# REMARKS: Generic, re: tracking.foxnews.com/HG? 10/01/06 +tracking. +#MASTER# BLOCK-REFERRER: http://netcraft.com and many others 10/22/06 +/(.*/)?adjs\.php\? +#MASTER# BLOCK-REFERRER: http://groups.yahoo.com/group/epdf/ 10/08/06 +.bc.yahoo.com/b\?P= +#MASTER# BLOCK-REFERRER: http://www.motherboard.cz 10/30/06 +x*.alexa.com +#MASTER# BLOCK-REFERRER: http://mplayernetwork.com 11/07/06 +#MASTER# BLOCK-REFERRER: http://eetimes.com 09/26/06 +/event.ng/ +#MASTER# BLOCK-REFERRER: http://www.homedepot.com/ 11/08/06 +#MASTER# BLOCK-REFERRER: http://www.williams-sonoma.com/ 11/08/06 +/cm\?[tc] +#MASTER# BLOCK-REFERRER: http://www.snapfiles.com/feedback/ 12/13/06 SF tracker +.snapfiles.net/rotation/.*\.asp +#MASTER# BLOCK-REFERRER: not provided. SF tracker #1616034 12/16/06 +#MASTER# COMMENT: JS pop-ups +spa.snap.com/ +#MASTER# BLOCK-REFERRER: http://www.gamefaqs.com/computer/doswin/game/914819.html 12/18/06 +#MASTER# COMMENT: user tracking, and run-away assorted 'junk' +#MASTER# BLOCK-REFERRER: http://formwood.com 2007-11-12 +.insitemetrics.com/ +#MASTER# COMMENT: user tracking, and assorted 'junk' +#MASTER# BLOCK-REFERRER: http://blogblog.com 2007-11-12 +.extreme-dm.com/ +#MASTER# COMMENT: user tracking, and assorted 'junk' +#MASTER# BLOCK-REFERRER: http://www.schillmania.com 2007-11-12 +stats.reinvigorate.net/ +#MASTER# COMMENT: user tracking, and assorted 'junk' +#MASTER# BLOCK-REFERRER: http://wordpress.com 2007-11-12 +.getclicky.com/ +#MASTER# COMMENT: user tracking, and assorted 'junk' +#MASTER# BLOCK-REFERRER: http://infoworld.com 2007-11-12 +.quantserve.com +# Blocked URL = http://media.adrevolver.com/adrevolver/trace?sip=123&cpy=123 +media.adrevolver.com/ +#MASTER# REMARKS: Actionsfile feedback item #2975895 2010-03-24 +# Blocked URL = http://static.chartbeat.com/js/chartbeat.js +.chartbeat.com/(.*/)?chartbeat\.js$ +# Blocked URL = http://js.adlink.net/js?lang=de&s=duesseldorf-international.de&z=home&d=1274103403564 +#MASTER# BLOCK-REFERRER: http://www.duesseldorf-international.de/ +js.adlink.net/ +# Blocked URL = nl.sitestat.com/rdw/rdw/s?www.nl.voertuigeigenaar.voertuigeigenaar&ns__t=1274099350343 +#MASTER# BLOCK-REFERRER: http://www.rdw.nl/nl/voertuigeigenaar/ +.sitestat.com/ +#MASTER# BLOCK-REFERRER: http://www.chip.de/artikel/c_artikelunterseite_10423683.html +# Blocked URL = http://pagead.googlesyndication.example.com/foo/bar/baz.js +pagead*.googlesyndication./.*\.js +#MASTER# BLOCK-REFERRER: http://www.pcmag.com/ 11/22/06 per SF Tracker # 1601148 +/js/slider\.js +#MASTER# BLOCK-REFERRER: http://floodle.net 2007-01-21 SF tracker +scripts.chitika.net/.*\.js +#MASTER# BLOCK-REFERRER: via Yahoo groups +#MASTER# REMARKS: Actionsfile tracker 1645513 2007-01-26 +.adinterax.com/.*\.js +#MASTER# BLOCK-REFERRER: http://dictionary.reference.com/search?q=privacy&db=* +#MASTER# REMARKS: Actionsfile tracker 1650798 2007-02-02 +# Blocked URL = http://partner.googleadservices.com/gampad/google_service.js +# Blocked URL = http://partner.googleadservices.com/gampad/google_ads.js +# Blocked URL = http://partner.googleadservices.com/gampad/slotdata.js?callback=_GA_googleAdData.setAdSlotAttributes&client=ca-gam-lexico +.googleadservices.com/gampad/.*\.js +# Blocked URL = http://richmedia.yimg.com/js/123/personnals_banners/PER_happy_sara1_4_425x600/ad.js?q=123 +/.*/ad\.js\? +# Blocked URL = http://i.cmpnet.com/shared/omniture/s_code_remote.js +#MASTER# BLOCK-REFERRER: http://www.informationweek.de/ +/.*omniture.*\.js +# Blocked URL = http://gadk.hit.gemius.pl/*/_1274097577014/rexdot.gif?l=30&id=..DlR.vCLZGB56RmfkYNSWZVLSqB3ueYOP.Oec5WWiv.h7&fr=1&fv=WIN%2010%2C0%2C45%2C2&tz=-120&href=http%3A//www.baadgalleri.dk/&ref=&screen=1440x900&col=32 +#MASTER# BLOCK-REFERRER: http://www.baadgalleri.dk/ +.gemius.pl/ + + +{+block{Might be a web-bug.} -handle-as-empty-document +handle-as-image} +#MASTER# BLOCK-REFERRER: http://versiontracker.com and many others. 10/20/06 +/(.*/)?__utm.gif\? +#MASTER# BLOCK-REFERRER: http://washingpost.com and others 10/25/06 +/.*\.gif\?D=DM +#MASTER# BLOCK-REFERRER: http://www.washingtonpost.com/ +#stats.surfaid.ihost.com/(crc/)?images/(bounce/)?uc.GIF +#MASTER# BLOCK-REFERRER: http://www.ibm.com 10/09/06 +#MASTER# REMARKS: Similar hostname and paths appear in multiple locations. +# Blocked URL = http://stats.surfaid.ihost.com/crc/images/bounce/uc.GIF +# Blocked URL = http://stats.surfaid.ihost.com/rc/images/bounce/uc.GIF +stats./c?rc/.*/uc.gif +#MASTER# BLOCK-REFERRER: http://priceline.com 10/20/06 +#MASTER# REMARKS: User tracking, webbug stuff +/(.*/)?dcs.gif\?&?dcs +#MASTER# BLOCK-REFERRER: http://www.msnbc.com 10/07/06 +#MASTER# REMARKS: And MANY others. Webbug stuff. +/(.*/)?c(lear)?\.gif\?. +#MASTER# BLOCK-REFERRER: http://www.investorguide.com 10/08/06 +#MASTER# BLOCK-REFERRER: http://foodnetwork.com, http://gardenweb.com 10/20/06 +#MASTER# REMARK: webbug type gif used in MANY places. +#MASTER# REMARK: Too many false positives +#/(.*/)?(clear|(trans_?1x|blank)?1).gif +#MASTER# REMARK: Let's try this way. +/(.*/)?(clear|blank|(trans_?|1x)?1).gif\?. +#MASTER# BLOCK-REFERRER: http://actorstheatre.org 11/02/06 +stats./.*\.gif\? +# Blocked URL = http://ad.yieldmanager.com/pixel?id=123456&t=2 +.yieldmanager.com/pixel\? +# Blocked URL = http://a.analytics.yahoo.com/p.pl?a=1000226660965&js=no +# Blocked URL = http://s.analytics.yahoo.com/fpc.pl?a=1000461640983&v=4.43&enc=utf-8&f=http%3A//www.zoover.nl/nederland/limburg/maasbracht/weer%23tabs&b=Het%20Weer%20in%20Maasbracht.%20Bekijk%20Weersverwachting%20van%20Maasbracht%20%7C%20Zoover%23tabs&flv=WIN%2010%2C0%2C45%2C2&d=Mon%2C%2017%20May%202010%2014%3A09%3A26%20UTC&n=-2&g=nl&h=Y&j=1440x900&k=32&l=true&ittidx=0&fpc=uP04C7j4%7ClaDQjglKaa%7Cfses1000461640983%3D%7CkbSSgv6Jaa%7CuP04C7j4%7Cfvis1000461640983%3DZj1odHRwJTNBLy93d3cuem9vdmVyLm5sLyZiPVpvb3ZlciUyMCU3QyUyMFZha2FudGllYmVvb3JkZWxpbmdlbiUyMHZvb3IlMjBlbiUyMGRvb3IlMjByZWl6aWdlcnM%3D%7C8sHTYo10oM%7C8sHTYo10oM%7C8sHTYo10oM%7CT%7C8sHTYo10oM%7C8sHTYo10oM +.analytics.yahoo.com +#MASTER# BLOCK-REFERRER: http://www.aktivist.pl/ +# Blocked URL = http://go.idmnet.bbelements.com/please/showit/46/1/1/1/?typkodu=img&keywords= +go.idmnet.bbelements.com/please/showit/ + ############################################################################# # Site-specific block patterns; ############################################################################# @@ -948,137 +1085,12 @@ # Blocked URL = http://atemda.com/ClickThrough.ashx?pId=9616&mId=14484&tId=634102151426089505&opS=1&admetac=mR3sJ3%2b9yleq%2bHowITh0hw%3d%3d #MASTER# BLOCK-REFERRER: http://www.startpagina.nl .atemda.com/ -#MASTER# Remark: 2o7.net and omtrdc.net are domains used by Omniture +#MASTER# Remark: 2o7.net, omtrdc.net and www91.intel.com are domains used by Omniture # Blocked URL = http://ciscosystemsinc.tt.omtrdc.net/m2/ciscosystemsinc/mbox/standard?mboxHost=www.cisco.com&mboxSession=12 .omtrdc.net/ +# Blocked URL = http://www91.intel.com/b/ss/intelcorp,intelcorpdc/...ONDataProvider.aspx%3FDownloadType%3DDrivers&ot=A&AQE=1 +www91.intel.com/ -#---------------------------------------------------------------------------- -# Misc Web-bugs, JS and just plain Junk. Images here aren't normal images. -#---------------------------------------------------------------------------- -{+block{Might be a web-bug.} +handle-as-empty-document -handle-as-image} -#MASTER# REMARKS: signature for user tracking nytimes, cnn.com,latimes.com and many others. 10/06/06 -/b/ss/.+ -#MASTER# BLOCK-REFERRER: http://www.thesun.co.uk/article/0,,11071-10784,00.html -#MASTER# REMARKS: widespread hitbox signature 10/06/06 -/HG\?hc= -#MASTER# BLOCK-REFERRER: http://macaddict.com 10/06/06 -.visistat.com -#MASTER# REMARKS: See for user tracking. -#MASTER# REMARKS: There is a ssl.google-analytics as well. -.google-analytics./ -#MASTER# REMARKS: Below Moved here from -handle-as-image 10/16/06 ########## -#MASTER# BLOCK-REFERRER: http://forums2.gardenweb.com/forums/orchids/ 09/25/06 -#MASTER# REMARKS: Mostly JS and plain text stuff -.overture. -#MASTER# PROBLEM-URL: http://www.linuxtoday.com/ -#MASTER# REMARKS: /adi has HTML snipplets for use in IFRAMEs 10/15/06 -.doubleclick.net/adi -.doubleclick.net/(.*/)?adj/ -#MASTER# PROBLEM-URL: http://maps.yahoo.com/ -#MASTER# REMARKS: /AVE/iview has HTML snipplets for use in IFRAMEs 10/15/06 -view.atdmt.com/(.*/)?iview/ -#MASTER# REMARKS: Above Moved here from -handle-as-image 10/16/06 ########## -#MASTER# REMARKS: Generic, re: tracking.foxnews.com/HG? 10/01/06 -tracking. -#MASTER# BLOCK-REFERRER: http://netcraft.com and many others 10/22/06 -/(.*/)?adjs\.php\? -#MASTER# BLOCK-REFERRER: http://groups.yahoo.com/group/epdf/ 10/08/06 -.bc.yahoo.com/b\?P= -#MASTER# BLOCK-REFERRER: http://www.motherboard.cz 10/30/06 -x*.alexa.com -#MASTER# BLOCK-REFERRER: http://mplayernetwork.com 11/07/06 -#MASTER# BLOCK-REFERRER: http://eetimes.com 09/26/06 -/event.ng/ -#MASTER# BLOCK-REFERRER: http://www.homedepot.com/ 11/08/06 -#MASTER# BLOCK-REFERRER: http://www.williams-sonoma.com/ 11/08/06 -/cm\?[tc] -#MASTER# BLOCK-REFERRER: http://www.snapfiles.com/feedback/ 12/13/06 SF tracker -.snapfiles.net/rotation/.*\.asp -#MASTER# BLOCK-REFERRER: not provided. SF tracker #1616034 12/16/06 -#MASTER# COMMENT: JS pop-ups -spa.snap.com/ -#MASTER# BLOCK-REFERRER: http://www.gamefaqs.com/computer/doswin/game/914819.html 12/18/06 -#MASTER# COMMENT: user tracking, and run-away assorted 'junk' -#MASTER# BLOCK-REFERRER: http://formwood.com 2007-11-12 -.insitemetrics.com/ -#MASTER# COMMENT: user tracking, and assorted 'junk' -#MASTER# BLOCK-REFERRER: http://blogblog.com 2007-11-12 -.extreme-dm.com/ -#MASTER# COMMENT: user tracking, and assorted 'junk' -#MASTER# BLOCK-REFERRER: http://www.schillmania.com 2007-11-12 -stats.reinvigorate.net/ -#MASTER# COMMENT: user tracking, and assorted 'junk' -#MASTER# BLOCK-REFERRER: http://wordpress.com 2007-11-12 -.getclicky.com/ -#MASTER# COMMENT: user tracking, and assorted 'junk' -#MASTER# BLOCK-REFERRER: http://infoworld.com 2007-11-12 -.quantserve.com -# Blocked URL = http://media.adrevolver.com/adrevolver/trace?sip=123&cpy=123 -media.adrevolver.com/ -#MASTER# REMARKS: Actionsfile feedback item #2975895 2010-03-24 -# Blocked URL = http://static.chartbeat.com/js/chartbeat.js -.chartbeat.com/(.*/)?chartbeat\.js$ -# Blocked URL = http://js.adlink.net/js?lang=de&s=duesseldorf-international.de&z=home&d=1274103403564 -#MASTER# BLOCK-REFERRER: http://www.duesseldorf-international.de/ -js.adlink.net/ -# Blocked URL = nl.sitestat.com/rdw/rdw/s?www.nl.voertuigeigenaar.voertuigeigenaar&ns__t=1274099350343 -#MASTER# BLOCK-REFERRER: http://www.rdw.nl/nl/voertuigeigenaar/ -.sitestat.com/ -#MASTER# BLOCK-REFERRER: http://www.chip.de/artikel/c_artikelunterseite_10423683.html -# Blocked URL = http://pagead.googlesyndication.example.com/foo/bar/baz.js -pagead*.googlesyndication./.*\.js -#MASTER# BLOCK-REFERRER: http://www.pcmag.com/ 11/22/06 per SF Tracker # 1601148 -/js/slider\.js -#MASTER# BLOCK-REFERRER: http://floodle.net 2007-01-21 SF tracker -scripts.chitika.net/.*\.js -#MASTER# BLOCK-REFERRER: via Yahoo groups -#MASTER# REMARKS: Actionsfile tracker 1645513 2007-01-26 -.adinterax.com/.*\.js -#MASTER# BLOCK-REFERRER: http://dictionary.reference.com/search?q=privacy&db=* -#MASTER# REMARKS: Actionsfile tracker 1650798 2007-02-02 -# Blocked URL = http://partner.googleadservices.com/gampad/google_service.js -# Blocked URL = http://partner.googleadservices.com/gampad/google_ads.js -# Blocked URL = http://partner.googleadservices.com/gampad/slotdata.js?callback=_GA_googleAdData.setAdSlotAttributes&client=ca-gam-lexico -.googleadservices.com/gampad/.*\.js -# Blocked URL = http://richmedia.yimg.com/js/123/personnals_banners/PER_happy_sara1_4_425x600/ad.js?q=123 -/.*/ad\.js\? -# Blocked URL = http://i.cmpnet.com/shared/omniture/s_code_remote.js -#MASTER# BLOCK-REFERRER: http://www.informationweek.de/ -/.*omniture.*\.js - - -{+block{Might be a web-bug.} -handle-as-empty-document +handle-as-image} -#MASTER# BLOCK-REFERRER: http://versiontracker.com and many others. 10/20/06 -/(.*/)?__utm.gif\? -#MASTER# BLOCK-REFERRER: http://washingpost.com and others 10/25/06 -/.*\.gif\?D=DM -#MASTER# BLOCK-REFERRER: http://www.washingtonpost.com/ -#stats.surfaid.ihost.com/(crc/)?images/(bounce/)?uc.GIF -#MASTER# BLOCK-REFERRER: http://www.ibm.com 10/09/06 -#MASTER# REMARKS: Similar hostname and paths appear in multiple locations. -# Blocked URL = http://stats.surfaid.ihost.com/crc/images/bounce/uc.GIF -# Blocked URL = http://stats.surfaid.ihost.com/rc/images/bounce/uc.GIF -stats./c?rc/.*/uc.gif -#MASTER# BLOCK-REFERRER: http://priceline.com 10/20/06 -#MASTER# REMARKS: User tracking, webbug stuff -/(.*/)?dcs.gif\?&?dcs -#MASTER# BLOCK-REFERRER: http://www.msnbc.com 10/07/06 -#MASTER# REMARKS: And MANY others. Webbug stuff. -/(.*/)?c(lear)?\.gif\?. -#MASTER# BLOCK-REFERRER: http://www.investorguide.com 10/08/06 -#MASTER# BLOCK-REFERRER: http://foodnetwork.com, http://gardenweb.com 10/20/06 -#MASTER# REMARK: webbug type gif used in MANY places. -#MASTER# REMARK: Too many false positives -#/(.*/)?(clear|(trans_?1x|blank)?1).gif -#MASTER# REMARK: Let's try this way. -/(.*/)?(clear|blank|(trans_?|1x)?1).gif\?. -#MASTER# BLOCK-REFERRER: http://actorstheatre.org 11/02/06 -stats./.*\.gif\? -# Blocked URL = http://ad.yieldmanager.com/pixel?id=123456&t=2 -.yieldmanager.com/pixel\? -# Blocked URL = http://a.analytics.yahoo.com/p.pl?a=1000226660965&js=no -# Blocked URL = http://s.analytics.yahoo.com/fpc.pl?a=1000461640983&v=4.43&enc=utf-8&f=http%3A//www.zoover.nl/nederland/limburg/maasbracht/weer%23tabs&b=Het%20Weer%20in%20Maasbracht.%20Bekijk%20Weersverwachting%20van%20Maasbracht%20%7C%20Zoover%23tabs&flv=WIN%2010%2C0%2C45%2C2&d=Mon%2C%2017%20May%202010%2014%3A09%3A26%20UTC&n=-2&g=nl&h=Y&j=1440x900&k=32&l=true&ittidx=0&fpc=uP04C7j4%7ClaDQjglKaa%7Cfses1000461640983%3D%7CkbSSgv6Jaa%7CuP04C7j4%7Cfvis1000461640983%3DZj1odHRwJTNBLy93d3cuem9vdmVyLm5sLyZiPVpvb3ZlciUyMCU3QyUyMFZha2FudGllYmVvb3JkZWxpbmdlbiUyMHZvb3IlMjBlbiUyMGRvb3IlMjByZWl6aWdlcnM%3D%7C8sHTYo10oM%7C8sHTYo10oM%7C8sHTYo10oM%7CT%7C8sHTYo10oM%7C8sHTYo10oM -.analytics.yahoo.com #---------------------------------------------------------------------------- # JavaScripts and Texts for ad and popup generation @@ -1399,6 +1411,14 @@ b.scorecardresearch.com/ # URL = https://sb.scorecardresearch.com/ sb.scorecardresearch.com/ +#MASTER# BLOCK-REFERRER: http://sourceforge.net/projects/ijbswa/ +# Blocked URL = http://b.collective-media.net/seg/cm/cm_aa_gn1 +b.collective-media.net/ +#MASTER# BLOCK-REFERRER: http://www.spiegel.de/ +# Blocked URL = http://spiegel.ivwbox.de/cgi-bin/ivw/CP/1001;/home/c-18/be-PB64-aG9tZXBhZ2UvY2VudGVy/szwprofil-1001 +#MASTER# BLOCK-REFERRER: http://www.heise.de/ +# Blocked URL = http://heise.ivwbox.de/2004/01/survey.js + .ivwbox.de/ #---------------------------------------------------------------------------- # Specific counters (see above for generic patterns) @@ -1704,7 +1724,8 @@ # URL = http://kb.adobe.com/selfservice/viewContent.do?externalId=kb402747&sliceId=1 .adobe.com # URL = http://qa.debian.org/popcon.php -qa.debian.org/popcon\.php +# URL = http://qa.debian.org/popcon-png.php?packages=privoxy&show_installed=on&want_legend=on&want_ticks=on&date_fmt=%25Y-%25m&beenhere=1 +qa.debian.org/popcon #MASTER# REMARKS: Support Requests item #2432535 2008-12-16 # URL = http://www.mta.info/bandt/traffic/advmain.htm .mta.info/.*advmain.htm$ @@ -1782,6 +1803,13 @@ #MASTER# REMARKS:Actionsfile feedback item #2974204 2010-03-21 # URL = http://adesklets.sourceforge.net/ adesklets.sourceforge.net/ +#MASTER# REMARKS: Mostly-french political blog +# URL = http://adassier.wordpress.com/ +adassier.wordpress.com/ +# URL = http://adassier.files.wordpress.com/2010/05/road-to-economic-recovery2.jpg?w=630&h=451 +adassier.files.wordpress.com +# URL = http://adainitiative.org/about-us/ +adainitiative.org/ ############################################################################# @@ -1948,6 +1976,10 @@ .youtube.com/swf/.*swf= # URL = http://redbot.org/?uri=http%3A//apache.org/ .redbot.org/ +# URL = http://webcache.googleusercontent.com/custom?hl=en&domains=library.gnome.org&sitesearch=library.gnome.org&q=cache:8yGDJ1YpefcJ:http://library.gnome.org/devel//gtk/2.20/GtkLabel.html+gtk_label_set_text+escape&ct=clnk +webcache.googleusercontent.com/ +# URL = http://webcache.googleusercontent.com/search?q=cache:kZYcDFibjHcJ:https://grepular.com/Abusing_HTTP_Status_Codes_to_Expose_Private_Information+inurl:https://grepular.com/Abusing_HTTP_Status_Codes_to_Expose_Private_Information&hl=en&strip=1 +.googleusercontent.com/.*=cache: {+redirect{s@.*url=@http://@} -block} # Sticky Actions = +redirect -block @@ -2105,6 +2137,8 @@ .couchsurfing.com/ # URL = http://www.couchsurfing.org/mapsurf.html .couchsurfing.org/ +# URL = http://www.thinkgeek.com/tshirts-apparel/unisex/generic/ +.thinkgeek.com/ {-filter{banners-by-link}} # Sticky Actions = -filter{banners-by-link} @@ -2265,6 +2299,9 @@ # Redirected URL = http://media.fastclick.net/w/get.media?sid=4681&m=5&tp=6&url=http%3A//www.sciam.com/article.cfm%3FchanID%3Dsa003%26articleID%3DC7C87ECC-E7F2-99DF-39AEFF3D7D1A8CFB%26ref%3Drss # Redirect Destination = http://www.sciam.com/article.cfm?chanID=sa003&articleID=C7C87ECC-E7F2-99DF-39AEFF3D7D1A8CFB&ref=rss .fastclick.net/w/get\.media\? +# Redirected URL = http://www.awin1.com/cread.php?awinmid=2891&awinaffid=43305&clickref=&p=http://www.groupon.co.uk/ +# Redirect Destination = http://www.groupon.co.uk/ +.awin1.com/.*=http:// {+block{Looks like an anti-leech trigger URL.}} #MASTER# COMMENTS: This section not checked 10/17/06 HB. Still out there? diff -Nru privoxy-3.0.17/default.filter privoxy-3.0.19/default.filter --- privoxy-3.0.17/default.filter 2010-09-03 17:40:07.000000000 +0000 +++ privoxy-3.0.19/default.filter 2011-10-16 14:01:05.000000000 +0000 @@ -2,7 +2,7 @@ # # File : $Source: /cvsroot/ijbswa/current/default.filter,v $ # -# $Id: default.filter,v 1.79 2010/09/03 17:40:07 fabiankeil Exp $ +# $Id: default.filter,v 1.83 2011/10/16 14:01:05 fabiankeil Exp $ # # Purpose : Rules to process the content of web pages # @@ -128,15 +128,15 @@ ################################################################################# # -# js-events: Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites). +# js-events: Kill JavaScript event bindings and timers (Radically destructive! Only for extra nasty sites). # ################################################################################# -FILTER: js-events Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites). +FILTER: js-events Kill JavaScript event bindings and timers (Radically destructive! Only for extra nasty sites). s/(on|event\.)((mouse(over|out|down|up|move))|(un)?load|contextmenu|selectstart)/never/ig # Not events, but abused on the same type of sites: s/(alert|confirm)\s*\(/concat(/ig -s/settimeout\(/concat(/ig +s/set(timeout|interval)\(/concat(/ig ################################################################################# # @@ -603,7 +603,7 @@ \#symadbn, \#ymadbn, .yschbox, .yschhd, .bbox, \#yschsec, \#sec,\ \#yschanswr, .yschftad, .yschspn, .yschspns, \#ygrp-sponsored-links,\ \#nwad, \#MWA2, \#MSCM, \#yregad, \#sponsored-links,\ - \#ks-ypn-ads, .ad, \#east, \#ygrp-vital {display: none !important;}\n\ + \#ks-ypn-ads, .ad, \#east, \#ygrp-vital, .ads {display: none !important;}\n\ \#yschpri, \#yschweb, \#pri, \#web, \#main, .yschttl, .abstr, .res \n\ {width: 99% !important; max-width: 100% !important;}\n\ .yschttl, .res, .res.indent, \#web {padding: 0px; margin: 0px !important;}\n\ @@ -632,6 +632,9 @@ max-width: 100% !important; /* width:100% sometimes causes horizontal scrollbars */}\n\ /* Remove "suggestions". They are next to worthless but partly overlap with the search results */\n\ .suggestion, \#nys_right, \#nys {clear: both; display:none;}\n\ + \#s_notf_div,\n \ + /* Overlay ads to enable Facebook 'likes' in search results. */\n\ + .sn_container {display:none !important;}\n\ \#content {padding-right: 0;}\n\ \n$0@ # Are these ids still in use? diff -Nru privoxy-3.0.17/doc/pcrs.3 privoxy-3.0.19/doc/pcrs.3 --- privoxy-3.0.17/doc/pcrs.3 2006-12-31 20:06:31.000000000 +0000 +++ privoxy-3.0.19/doc/pcrs.3 2011-09-06 18:44:51.000000000 +0000 @@ -28,7 +28,7 @@ .B "#include " .PP .br -.BI "pcrs_job *pcrs_compile(const char *" pattern "," +.BI "pcrs_job *pcrs_compile(const char *" pattern "," .ti +5n .BI "const char *" substitute ", const char *" options , .ti +5n @@ -68,7 +68,7 @@ The .SM PCRS -library is a supplement to the +library is a supplement to the .SB PCRE(3) library that implements .RB "regular expression based substitution, like provided by " Perl(1) "'s 's'" @@ -77,10 +77,10 @@ In a first step, the information on a substitution, i.e. the pattern, the substitute and the options are compiled from Perl syntax to an internal form -.RB "called " pcrs_job " by using either the " pcrs_compile() " or " +.RB "called " pcrs_job " by using either the " pcrs_compile() " or " .BR pcrs_compile_command() " functions." -Once the job is compiled, it can be used on subjects, which are arbitrary +Once the job is compiled, it can be used on subjects, which are arbitrary memory areas containing string or binary data, by calling .BR pcrs_execute() ". Jobs can be chained to joblists and whole" .RB "joblists can be applied to a subject using " pcrs_execute_list() . @@ -104,7 +104,7 @@ .RB "follows the '" "s" "' will be used as the delimiter. Patterns or substitutes" that contain the delimiter need to quote it: \fBs/th\\/is/th\\/at/\fR -.RB "will replace " "th/is" " by " "th/at" " and can be written more simply as" +.RB "will replace " "th/is" " by " "th/at" " and can be written more simply as" .BR "s|th/is|th/at|" "." .IR "pattern" ", " "substitute" ", " "options" " and " "command" " must be" @@ -123,7 +123,7 @@ .SS Substitutes .RI "The " "substitute" " uses" .RB "Perl syntax as documented in the " "perlre(1)" " manual page, with" -some exceptions: +some exceptions: Most notably and evidently, since .SM PCRS @@ -147,9 +147,9 @@ if a global substitution previously matched. .PP -Perl4-style references to subpattern matches of the form +Perl4-style references to subpattern matches of the form \fB\\1, \\2, ...\fR -.RB "which only exist in Perl5 for backwards compatibility, are " "not" +.RB "which only exist in Perl5 for backwards compatibility, are " "not" supported. Also, since the substitute is a double-quoted string in Perl, you @@ -269,7 +269,7 @@ .SS String subjects -If your +If your .SS Return value and diagnostics @@ -298,7 +298,7 @@ Chaining the jobs is up to you, but once you have built a linked list of jobs, .RI "you can execute a whole " joblist " on a given subject by" .RB "a single call to " pcrs_execute_list() ", which will sequentially traverse" -.RB "the linked list until it reaches a " NULL " pointer, and call " pcrs_execute() +.RB "the linked list until it reaches a " NULL " pointer, and call " pcrs_execute() .RI "for each job it encounters, feeding the " result " and " result_length " of each" .RI "call into the next as the " subject " and " subject_length ". As in the single" .RI "job case, the original " subject " remains untouched, but all interim " result "s" @@ -335,22 +335,22 @@ While compiling the pattern, .SM PCRE ran out of memory. -.TP +.TP .B PCRS_ERR_NOMEM While compiling the job, .SM PCRS ran out of memory. -.TP +.TP .B PCRS_ERR_CMDSYNTAX .BR pcrs_compile_command() " didn't find four tokens while parsing the" .IR command . -.TP +.TP .B PCRS_ERR_STUDY A .SM PCRE .RB "error occured while studying the compiled pattern. Since " pcre_study() only provides textual diagnostic information, the details are lost. -.TP +.TP .B PCRS_WARN_BADREF .RI "The " substitute " contains a reference to a capturing subpattern that" .RI "has a higher index than the number of capturing subpatterns in the " pattern @@ -368,12 +368,12 @@ ran out of memory. This can only happen if there are more than 33 backrefrences .RI "in the " pattern "(!)" .BR and " memory is too tight to extend storage for more." -.TP +.TP .B PCRS_ERR_NOMEM While executing the job, .SM PCRS ran out of memory. -.TP +.TP .B PCRS_ERR_BADJOB .RB "The " pcrs_job "* passed to " pcrs_execute " was NULL, or the" .RB "job is bogus (it contains " NULL " pointers to the compiled diff -Nru privoxy-3.0.17/doc/source/authors.sgml privoxy-3.0.19/doc/source/authors.sgml --- privoxy-3.0.17/doc/source/authors.sgml 2010-11-06 12:55:48.000000000 +0000 +++ privoxy-3.0.19/doc/source/authors.sgml 2011-12-26 17:05:40.000000000 +0000 @@ -2,31 +2,31 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/authors.sgml,v $ Purpose : AUTHORS file for Privoxy - - $Id: authors.sgml,v 2.17 2010/11/06 12:55:48 fabiankeil Exp $ - + $Id: authors.sgml,v 2.21 2011/12/26 17:05:40 fabiankeil Exp $ + + Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. You have been warned! - Failure to abide by this rule will result in the revocation of your license + Failure to abide by this rule will result in the revocation of your license to live a peaceful existence! ======================================================================== =================================================================== - READ: Document Note: This file generates the AUTHORS file in the + READ: Document Note: This file generates the AUTHORS file in the top level source directory. See p-authors.sgml for list of developers and contributors, etc. They were split from here for use in man page. =================================================================== --> + - + diff -Nru privoxy-3.0.17/doc/source/buildsource.sgml privoxy-3.0.19/doc/source/buildsource.sgml --- privoxy-3.0.17/doc/source/buildsource.sgml 2009-03-21 10:50:13.000000000 +0000 +++ privoxy-3.0.19/doc/source/buildsource.sgml 2011-09-04 11:10:12.000000000 +0000 @@ -2,8 +2,8 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/buildsource.sgml,v $ Purpose : Entity included in other project documents. - - $Id: buildsource.sgml,v 2.18 2009/02/23 09:03:12 fabiankeil Exp $ + + $Id: buildsource.sgml,v 2.19 2011/09/04 11:10:12 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. @@ -12,7 +12,7 @@ This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -22,7 +22,7 @@ --> - To build Privoxy from source, + To build Privoxy from source, autoconf, GNU make @@ -32,12 +32,12 @@ When building from a source tarball, - first unpack the source: + tarball), +--> first unpack the source: @@ -63,7 +63,7 @@ - This will create a directory named current/, which will + This will create a directory named current/, which will contain the source tree. @@ -81,7 +81,7 @@ and group just for this purpose. See your local documentation for the correct command line to do add new users and groups (something like adduser, but the command syntax may vary from platform - to platform). + to platform). @@ -113,7 +113,7 @@ autoheader autoconf ./configure # (--help to see options) - make # (the make from GNU, sometimes called gmake) + make # (the make from GNU, sometimes called gmake) su # Possibly required make -n install # (to see where all the files will go) make -s install # (to really install, -s to silence output) @@ -135,14 +135,14 @@ - To build an executable with security enhanced features so that + To build an executable with security enhanced features so that users cannot easily bypass the proxy (e.g. Go There Anyway), or alter their own configurations, configure like this: ./configure --disable-toggle --disable-editor --disable-force - + Then build as above. In Privoxy 3.0.7 and later, all of these options can also be disabled through the configuration file. @@ -177,9 +177,9 @@ - The default installation path for make install is - /usr/local. This may of course be customized with - the various ./configure path options. If you are doing + The default installation path for make install is + /usr/local. This may of course be customized with + the various ./configure path options. If you are doing an install to anywhere besides /usr/local, be sure to set the appropriate paths with the correct configure options (./configure --help). Non-privileged users must of course @@ -209,15 +209,15 @@ localstatedir (ie: var/) will default to /var instead of $prefix/var so the logs will go to /var/log/privoxy/, and the pid file - will be created in /var/run/privoxy.pid. + will be created in /var/run/privoxy.pid. - make install will attempt to set the correct values - in config (main configuration file). You should + make install will attempt to set the correct values + in config (main configuration file). You should check this to make sure all values are correct. If appropriate, - an init script will be installed, but it is up to the user to determine - how and where to start Privoxy. The init + an init script will be installed, but it is up to the user to determine + how and where to start Privoxy. The init script should be checked for correct paths and values, if anything other than a default install is done. @@ -248,9 +248,9 @@ - The simplest command line to start Privoxy is - $path/privoxy --user=privoxy $path/etc/privoxy/config. - See privoxy --usage, or the man page, for other options, + The simplest command line to start Privoxy is + $path/privoxy --user=privoxy $path/etc/privoxy/config. + See privoxy --usage, or the man page, for other options, and configuration. ]]> diff -Nru privoxy-3.0.17/doc/source/config.sgml privoxy-3.0.19/doc/source/config.sgml --- privoxy-3.0.17/doc/source/config.sgml 2010-11-06 12:55:48.000000000 +0000 +++ privoxy-3.0.19/doc/source/config.sgml 2011-12-26 17:05:40.000000000 +0000 @@ -1,7 +1,7 @@ + - + @@ -12,19 +12,19 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/config.sgml,v $ Purpose : config file generation - - $Id: config.sgml,v 2.18 2010/11/06 12:55:48 fabiankeil Exp $ + + $Id: config.sgml,v 2.22 2011/12/26 17:05:40 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching - anything in this, or other Privoxy documentation. + NOTE: Please read developer-manual/documentation.html before touching + anything in this, or other Privoxy documentation. ======================================================================== - This file is used to generate the main Privoxy config file. It is mostly - content included from p-config.sgml (where all the data is). See that + This file is used to generate the main Privoxy config file. It is mostly + content included from p-config.sgml (where all the data is). See that file for more comments. --> diff -Nru privoxy-3.0.17/doc/source/contacting.sgml privoxy-3.0.19/doc/source/contacting.sgml --- privoxy-3.0.17/doc/source/contacting.sgml 2010-11-13 13:04:56.000000000 +0000 +++ privoxy-3.0.19/doc/source/contacting.sgml 2011-11-20 12:38:45.000000000 +0000 @@ -2,10 +2,10 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/contacting.sgml,v $ Purpose : Entity included in other project documents. - - $Id: contacting.sgml,v 2.23 2010/11/13 13:04:56 fabiankeil Exp $ - Copyright (C) 2001-2010 Privoxy Developers http://www.privoxy.org/ + $Id: contacting.sgml,v 2.30 2011/11/19 14:44:01 fabiankeil Exp $ + + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ====================================================================== @@ -29,13 +29,13 @@ We value your feedback. In fact, we rely on it to improve Privoxy and its configuration. - However, please note the following hints, so we can + However, please note the following hints, so we can provide you with the best support: Get Support - For casual users, our + For casual users, our support forum at SourceForge is probably best suited: http://sourceforge.net/tracker/?group_id=11118&atid=211118 @@ -53,6 +53,15 @@ + If you have to contact a Privoxy developer directly for other reasons, + please send a real mail and do not bother with SourceForge's messaging + system. Answers to SourceForge messages are usually bounced by SourceForge's + mail server in which case the developer wasted time writing a response you + don't get. From your point of view it will look like your message has + been completely ignored, so this is frustrating for all parties involved. + + + Note that the Privoxy mailing lists are moderated. Posts from unsubscribed addresses have to be accepted manually by a moderator. This may cause a delay of several days and if you use a subject that doesn't clearly @@ -77,30 +86,30 @@ - Configuration issues, such as ads that slip through, or sites that - don't function properly due to one Privoxy + Configuration issues, such as ads that slip through, or sites that + don't function properly due to one Privoxy action or another being turned on. - + - Bugs in the programming code that makes up + Bugs in the programming code that makes up Privoxy, such as that might cause a crash. - + Reporting Ads or Other Configuration Problems Please send feedback on ads that slipped through, innocent images that were - blocked, sites that don't work properly, and other configuration related problem of - default.action file, to + blocked, sites that don't work properly, and other configuration related problem of + default.action file, to http://sourceforge.net/tracker/?group_id=11118&atid=460288, the Actions File Tracker. - + New, improved default.action files may occasionally be made @@ -115,15 +124,15 @@ Reporting Bugs - Please report all bugs through our bug tracker: - http://sourceforge.net/tracker/?group_id=11118&atid=111118. + Please report all bugs through our bug tracker: + http://sourceforge.net/tracker/?group_id=11118&atid=111118. Before doing so, please make sure that the bug has not already been submitted and observe the additional hints at the top of the submit - form. If already submitted, please feel free to add any info to the + form. If already submitted, please feel free to add any info to the original report that might help to solve the issue. @@ -150,7 +159,7 @@ that your bug still exists. -Please be sure to provide the following information: + Please be sure to provide the following information: @@ -161,7 +170,7 @@ (if you got the source from CVS, please also provide the source code revisions as shown in http://config.privoxy.org/show-version). - + @@ -171,11 +180,11 @@ sending the output of uname -a should do, in case of GNU/Linux, please also name the distribution. - + - The name, platform, and version of the browser + The name, platform, and version of the browser you were using (e.g. Internet Explorer v5.5 for Mac). @@ -183,9 +192,9 @@ The URL where the problem occurred, or some way for us to duplicate the - problem (e.g. http://somesite.example.com/?somethingelse=123). + problem (e.g. http://somesite.example.com/?somethingelse=123). - + @@ -193,22 +202,22 @@ by the Privoxy developers via SourceForge, or if you got your copy somewhere else. - + - Whether you are using Privoxy in tandem with + Whether you are using Privoxy in tandem with another proxy such as Tor. If so, please temporary disable the other proxy to see if the symptoms change. - + - Whether you are using a personal firewall product. If so, does + Whether you are using a personal firewall product. If so, does Privoxy work without it? - + @@ -237,7 +246,7 @@ submit any logfiles you didn't read first. You can mask sensitive information as long as it's clear that you removed something. - + @@ -263,9 +272,15 @@ + If you are new to reporting problems, you might be interested in + How to Report Bugs Effectively. + + + The appendix - of the Privoxy User Manual also has helpful information - on understanding actions, and action debugging. + of the Privoxy User Manual also has helpful information + on understanding actions, and action debugging. diff -Nru privoxy-3.0.17/doc/source/copyright.sgml privoxy-3.0.19/doc/source/copyright.sgml --- privoxy-3.0.17/doc/source/copyright.sgml 2010-02-19 22:32:10.000000000 +0000 +++ privoxy-3.0.19/doc/source/copyright.sgml 2011-09-04 11:10:12.000000000 +0000 @@ -2,17 +2,17 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/copyright.sgml,v $ Purpose : Entity included in other project documents. - - $Id: copyright.sgml,v 2.11 2010/02/13 16:36:54 fabiankeil Exp $ - Copyright (C) 2001-2010 Privoxy Developers http://www.privoxy.org/ + $Id: copyright.sgml,v 2.14 2011/09/04 11:10:12 fabiankeil Exp $ + + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ====================================================================== This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -23,8 +23,8 @@ faq ************************************************************** - NOTE: the &my-copy entity must be defined in any file that will - include this file. (This is a workaround for docbook2man not + NOTE: the &my-copy entity must be defined in any file that will + include this file. (This is a workaround for docbook2man not handling the standard © entity in the man page processing.) ************************************************************** @@ -36,7 +36,7 @@ --> - Copyright &my-copy; 2001-2010 by Privoxy Developers ijbswa-developers@lists.sourceforge.net + Copyright &my-copy; 2001-2011 by Privoxy Developers ijbswa-developers@lists.sourceforge.net diff -Nru privoxy-3.0.17/doc/source/developer-manual.sgml privoxy-3.0.19/doc/source/developer-manual.sgml --- privoxy-3.0.17/doc/source/developer-manual.sgml 2010-11-06 12:55:48.000000000 +0000 +++ privoxy-3.0.19/doc/source/developer-manual.sgml 2011-12-26 17:05:40.000000000 +0000 @@ -1,5 +1,5 @@ + @@ -8,7 +8,7 @@ - + @@ -23,16 +23,16 @@ Purpose : developer manual This file belongs into ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/ - - $Id: developer-manual.sgml,v 2.34 2010/11/06 12:55:48 fabiankeil Exp $ + + $Id: developer-manual.sgml,v 2.38 2011/12/26 17:05:40 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. You have been warned! - Failure to abide by this rule will result in the revocation of your license + Failure to abide by this rule will result in the revocation of your license to live a peaceful existence! ======================================================================== @@ -45,24 +45,24 @@ - Copyright &my-copy; 2001-2009 by + Copyright &my-copy; 2001-2009 by Privoxy Developers - $Id: developer-manual.sgml,v 2.34 2010/11/06 12:55:48 fabiankeil Exp $ + $Id: developer-manual.sgml,v 2.38 2011/12/26 17:05:40 fabiankeil Exp $ @@ -118,16 +118,16 @@ I don't like seeing blank space :) So added *something* here. - --> + --> Privoxy, as an heir to - Junkbuster, is a Free Software project + Junkbuster, is a Free Software project and the code is licensed under the GNU General Public License version 2. As such, Privoxy development is potentially open to anyone who has the time, knowledge, and desire to contribute in any capacity. Our goals are simply to continue the mission, to improve Privoxy, and - to make it available to as wide an audience as possible. + to make it available to as wide an audience as possible. One does not have to be a programmer to contribute. Packaging, testing, @@ -139,19 +139,19 @@ The first step is to join the developer's mailing list. - You can submit your ideas, or even better patches. Patches are best - submitted to the Sourceforge tracker set up for this purpose, but + You can submit your ideas, or even better patches. Patches are best + submitted to the Sourceforge tracker set up for this purpose, but can be sent to the list for review too. - You will also need to have a cvs package installed, which will + You will also need to have a cvs package installed, which will entail having ssh installed as well (which seems to be a requirement of SourceForge), in order to access the cvs repository. Having the GNU build tools is also going to be important (particularly, autoconf and gmake). - For the time being (read, this section is under construction), you can - also refer to the extensive comments in the source code. In fact, + For the time being (read, this section is under construction), you can + also refer to the extensive comments in the source code. In fact, reading the code is recommended in any case. @@ -161,7 +161,7 @@ The CVS Repository If you become part of the active development team, you will eventually - need write access to our holy grail, the CVS repository. One of the + need write access to our holy grail, the CVS repository. One of the team members will need to set this up for you. Please read this chapter completely before accessing via CVS. @@ -206,21 +206,21 @@ At one time there were two distinct branches: stable and unstable. The - more drastic changes were to be in the unstable branch. These branches - have now been merged to minimize time and effort of maintaining two + more drastic changes were to be in the unstable branch. These branches + have now been merged to minimize time and effort of maintaining two branches. - + --> CVS Commit Guidelines @@ -231,16 +231,16 @@ main development trunk, and we ask anyone with CVS access to strictly adhere to the following guidelines: - + Basic Guidelines, for all branches: - Please don't commit even + Please don't commit even a small change without testing it thoroughly first. When we're - close to a public release, ask a fellow developer to review your + close to a public release, ask a fellow developer to review your changes. @@ -269,18 +269,18 @@ url="http://sourceforge.net/tracker/?atid=311118&group_id=11118&func=browse">patch tracker instead. - + - + - + Documentation Guidelines All formal documents are maintained in Docbook SGML and located in the doc/source/* directory. You will need - Docbook, the Docbook + Docbook, the Docbook DTD's and the Docbook modular stylesheets (or comparable alternatives), and either jade or openjade (recommended) installed in order to @@ -337,20 +337,20 @@ privoxy.1 (man page), and config files are also now maintained as Docbook SGML. These files, when built, in the top-level source directory are - generated files! Also, the Privoxy index.html (and a - variation on this file, privoxy-index.html, + generated files! Also, the Privoxy index.html (and a + variation on this file, privoxy-index.html, meant for inclusion with doc packages), are maintained as SGML as well. DO NOT edit these directly. Edit the SGML source, or contact someone involved in the documentation. - + config requires some special handling. The reason it is maintained this way is so that the extensive comments in the file - mirror those in user-manual. But the conversion - process requires going from SGML to HTML to text to special formatting + mirror those in user-manual. But the conversion + process requires going from SGML to HTML to text to special formatting required for the embedded comments. Some of this does not survive so well. Especially some of the examples that are longer than 80 characters. - The build process for this file outputs to config.new, + The build process for this file outputs to config.new, which should be reviewed for errors and mis-formatting. Once satisfied that it is correct, then it should be hand copied to config. @@ -362,8 +362,8 @@ Packagers are encouraged to include this documentation. For those without the ability to build the docs locally, text versions of each are kept in - CVS. HTML versions are also being kept in CVS under - doc/webserver/*. And PDF version are kept in + CVS. HTML versions are also being kept in CVS under + doc/webserver/*. And PDF version are kept in doc/pdf/*. @@ -381,7 +381,7 @@ How do you update the webserver (i.e. the pages on privoxy.org)? - + First, build the docs by running make @@ -399,7 +399,7 @@ Finished docs should be occasionally submitted to CVS - (doc/webserver/*/*.html) so that those without + (doc/webserver/*/*.html) so that those without the ability to build them locally, have access to them if needed. This is especially important just prior to a new release! Please do this after the $VERSION and @@ -411,14 +411,14 @@ Quickstart to Docbook and SGML - If you are not familiar with SGML, it is a markup language similar to HTML. - Actually, not a mark up language per se, but a language used to define + If you are not familiar with SGML, it is a markup language similar to HTML. + Actually, not a mark up language per se, but a language used to define markup languages. In fact, HTML is an SGML application. Both will use tags to format text and other content. SGML tags can be much more varied, and flexible, but do much of the same kinds of things. The tags, or elements, are definable in SGML. There is no set standards. Since we are using - Docbook, our tags are those that are defined by + Docbook, our tags are those that are defined by Docbook. Much of how the finish document is rendered is determined by the stylesheets. The stylesheets determine how each tag gets translated to HTML, or other @@ -435,26 +435,26 @@ Our documents use sections for the most part. Sections - will be processed into HTML headers (e.g. h1 for + will be processed into HTML headers (e.g. h1 for sect1). The Docbook stylesheets - will use these to also generate the Table of Contents for each doc. Our - TOC's are set to a depth of three. Meaning sect1, - sect2, and sect3 will have TOC - entries, but sect4 will not. Each section requires - a <title> element, and at least one - <para>. There is a limit of five section - levels in Docbook, but generally three should be sufficient for our + will use these to also generate the Table of Contents for each doc. Our + TOC's are set to a depth of three. Meaning sect1, + sect2, and sect3 will have TOC + entries, but sect4 will not. Each section requires + a <title> element, and at least one + <para>. There is a limit of five section + levels in Docbook, but generally three should be sufficient for our purposes. - Some common elements that you likely will use: + Some common elements that you likely will use: - <para></para>, paragraph delimiter. Most + <para></para>, paragraph delimiter. Most text needs to be within paragraph elements (there are some exceptions). @@ -468,7 +468,7 @@ <command></command>, command examples. - <literallayout></literallayout>, like + <literallayout></literallayout>, like <pre>, more or less. @@ -478,15 +478,15 @@ <listitem></listitem>, member of the above. - <screen></screen>, screen output, implies + <screen></screen>, screen output, implies <literallayout>. - <ulink url="example.com"></ulink>, like + <ulink url="example.com"></ulink>, like HTML <a> tag. - <quote></quote>, for, doh, quoting text. + <quote></quote>, for, doh, quoting text. @@ -506,8 +506,8 @@ <application>Privoxy</application> Documentation Style - It will be easier if everyone follows a similar writing style. This - just makes it easier to read what someone else has written if it + It will be easier if everyone follows a similar writing style. This + just makes it easier to read what someone else has written if it is all done in a similar fashion. @@ -519,7 +519,7 @@ All tags should be lower case. - + Tags delimiting a block of text (even small @@ -534,11 +534,11 @@ Just to <emphasis>emphasize</emphasis>, some text goes here. - + Tags should be nested and step indented for block text like: (except - in-line tags) + in-line tags) <para> <itemizedlist> @@ -552,48 +552,48 @@ This makes it easier to find the text amongst the tags ;-) - + - Use white space to separate logical divisions within a document, - like between sections. Running everything together consistently + Use white space to separate logical divisions within a document, + like between sections. Running everything together consistently makes it harder to read and work on. - + - Do not hesitate to make comments. Comments can either use the - <comment> element, or the <!-- --> style comment - familiar from HTML. (Note in Docbook v4.x <comment> is + Do not hesitate to make comments. Comments can either use the + <comment> element, or the <!-- --> style comment + familiar from HTML. (Note in Docbook v4.x <comment> is replaced by <remark>.) - + - We have an international audience. Refrain from slang, or English - idiosyncrasies (too many to list :). Humor also does not translate + We have an international audience. Refrain from slang, or English + idiosyncrasies (too many to list :). Humor also does not translate well sometimes. - + Try to keep overall line lengths in source files to 80 characters or less for obvious reasons. This is not always possible, with lengthy URLs for instance. - + - Our documents are available in differing formats. Right now, they - are just plain text, HTML, and PDF, but others are always a - future possibility. Be careful with URLs (<ulink>), and avoid + Our documents are available in differing formats. Right now, they + are just plain text, HTML, and PDF, but others are always a + future possibility. Be careful with URLs (<ulink>), and avoid this mistake: My favorite site is <ulink url="http://example.com">here</ulink>. - This will render as My favorite site is here, which is + This will render as My favorite site is here, which is not real helpful in a text doc. Better like this: @@ -607,37 +607,37 @@ -H option. (ispell I think too.) - + - - + + - + Privoxy Custom Entities - Privoxy documentation is using - a number of customized entities to facilitate - documentation maintenance. + Privoxy documentation is using + a number of customized entities to facilitate + documentation maintenance. We are using a set of boilerplate files with generic text, that is used by multiple docs. This way we can write something once, and use it repeatedly without having to re-write the same content over and over again. If editing such a file, keep in mind that it should be - generic. That is the purpose; so it can be used in varying + generic. That is the purpose; so it can be used in varying contexts without additional modifications. - We are also using what Docbook calls - internal entities. These are like variables in + We are also using what Docbook calls + internal entities. These are like variables in programming. Well, sort of. For instance, we have the - p-version entity that contains the current - Privoxy version string. You are strongly - encouraged to use these where possible. Some of these obviously + p-version entity that contains the current + Privoxy version string. You are strongly + encouraged to use these where possible. Some of these obviously require re-setting with each release (done by the Makefile). A sampling of custom entities are listed below. See any of the main docs for examples. @@ -653,28 +653,28 @@ In this example, the contents of the file, - supported.sgml is available for inclusion anywhere - in the doc. To make this happen, just reference the now defined - entity: &supported; (starts with an ampersand - and ends with a semi-colon), and the contents will be dumped into + supported.sgml is available for inclusion anywhere + in the doc. To make this happen, just reference the now defined + entity: &supported; (starts with an ampersand + and ends with a semi-colon), and the contents will be dumped into the finished doc at that point. - + Commonly used internal entities: - p-version: the Privoxy + p-version: the Privoxy version string, e.g. &p-version;. - p-status: the project status, either + p-status: the project status, either alpha, beta, or stable. - p-not-stable: use to conditionally include + p-not-stable: use to conditionally include text in not stable releases (e.g. beta). @@ -684,16 +684,16 @@ p-text: this doc is only generated as text. - + - + - There are others in various places that are defined for a specific + There are others in various places that are defined for a specific purpose. Read the source! - + - + @@ -718,7 +718,7 @@ Using Comments - + Comment, Comment, Comment @@ -757,7 +757,7 @@ - + Use blocks for comments @@ -798,9 +798,9 @@ wish to "disrupt" the flow of the code, feel free to use a 1 line comment which is NOT on the same line as the code. - + - + Keep Comments on their own line @@ -853,7 +853,7 @@ } /* -END- do_something_very_important */ - + Comment each logical step @@ -871,9 +871,9 @@ comment. After all, these are usually major logic containers. - + - + Comment All Functions Thoroughly @@ -892,9 +892,9 @@ functions should contain the information presented in the addendum section of this document. - + - + Comment at the end of braces if the content is more than one screen length @@ -930,12 +930,12 @@ } /* -END- if ( 1 == X ) */ - + Naming Conventions - + Variable Names @@ -960,9 +960,9 @@ - - + + Function Names @@ -988,9 +988,9 @@ - + - + Header file prototypes @@ -1007,15 +1007,15 @@ Instead of: -(.h) extern int load_aclfile( struct client_state * ); or -(.h) extern int load_aclfile(); +(.h) extern int load_aclfile( struct client_state * ); or +(.h) extern int load_aclfile(); (.c) int load_aclfile( struct client_state *csp ) - + - + Enumerations, and #defines @@ -1043,7 +1043,7 @@ #endif /* def FEATURE_FORCE */ - + Constants @@ -1065,23 +1065,23 @@ -#define USE_IMG_LST 1 or +#define USE_IMG_LST 1 or #define _USE_IMAGE_LIST 1 or -#define USE_IMAGE_LIST_ 1 or +#define USE_IMAGE_LIST_ 1 or #define use_image_list 1 or #define UseImageList 1 - + - + Using Space - + Put braces on a line by themselves. @@ -1127,7 +1127,7 @@ } - + ALL control statements should have a block @@ -1160,9 +1160,9 @@ "feature". The "explanation" and "exception" from the point above also applies. - + - + Do not belabor/blow-up boolean expressions @@ -1181,9 +1181,9 @@ to the project has at least a "good" knowledge of C/C++. (Hope I do not offend by that last comment ... 8-) - + - + Use white space freely because it is free @@ -1205,7 +1205,7 @@ first_value = old_value + ( ( some_value - another_value ) - whatever ) - + Don't use white space around structure operators @@ -1229,9 +1229,9 @@ Instead of: a_struct -> a_member; a_struct . a_member; function_name (); - + - + Make the last brace of a function stand out @@ -1267,9 +1267,9 @@ Status: developer-discretion on the number of blank lines. Enforced is the end of function comments. - + - + Use 3 character indentions @@ -1306,11 +1306,11 @@ - + Initializing - + Initialize all variables @@ -1337,11 +1337,11 @@ - + Functions - + Name functions that return a boolean as a question. @@ -1358,7 +1358,7 @@ is_web_page_blank(); - + Always specify a return type for a function. @@ -1370,9 +1370,9 @@ purpose, and create a void return type if the function does not need to return anything. - + - + Minimize function calls when iterating by using variables @@ -1416,9 +1416,9 @@ *may* change or could *potentially* change, then you must code the function call in the for/while loop. - + - + Pass and Return by Const Reference @@ -1437,9 +1437,9 @@ Both these pointers are *const*! If the c runtime library maintainers do it, we should too. - + - + Pass and Return by Value @@ -1453,9 +1453,9 @@ prototypes with "pass by value": int load_aclfile( struct client_state *csp ) - + - + Names of include files @@ -1478,7 +1478,7 @@ -/* This is not a local include, but requires a path element. */ +/* This is not a local include, but requires a path element. */ #include <sys/fileName.h> @@ -1487,9 +1487,9 @@ without a _very_ good reason. This duplicates the #include "file.h" behavior. - + - + Provide multiple inclusion protection @@ -1512,7 +1512,7 @@ #endif /* ndef PROJECT_H_INCLUDED */ - + Use `extern "C"` when appropriate @@ -1536,7 +1536,7 @@ #endif /* def __cplusplus */ - + Where Possible, Use Forward Struct Declaration Instead of Includes @@ -1562,13 +1562,13 @@ Status: Use with discretion. - + General Coding Practices - + Turn on warnings @@ -1578,9 +1578,9 @@ should turn on as many as possible. With GCC, the switch is "-Wall". Try and fix as many warnings as possible. - + - + Provide a default case for all switch statements @@ -1623,9 +1623,9 @@ Status: Programmer discretion is advised. - + - + Try to avoid falling through cases in a switch statement. @@ -1648,9 +1648,9 @@ the fact of the fall through and reason why you felt it was necessary. - + - + Use 'long' or 'short' Instead of 'int' @@ -1666,9 +1666,9 @@ now). Should we add these to IJB now that we have a "configure" script? - + - + Don't mix size_t and other types @@ -1680,9 +1680,9 @@ variable of a different type (or even against a constant) without casting one of the values. - + - + Declare each variable and struct on its own line. @@ -1715,9 +1715,9 @@ Status: developer-discretion. - + - + Use malloc/zalloc sparingly @@ -1735,7 +1735,7 @@ list, then it should definitely be allocated via `malloc'. - + The Programmer Who Uses 'malloc' is Responsible for Ensuring 'free' @@ -1765,9 +1765,9 @@ standard is for allocating and freeing data structures (complex or nested). - + - + Add loaders to the `file_list' structure and in order @@ -1783,9 +1783,9 @@ POPUPs can also be referred to as KILLPOPUPs, it is clear that it should come first. - + - + "Uncertain" new code and/or changes to existing code, use FIXME or XXX @@ -1815,7 +1815,7 @@ include in the project (or conversely exclude from the project). - + @@ -1850,7 +1850,7 @@ * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or write to the Free Software Foundation, Inc., + * or write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , * USA * @@ -1904,7 +1904,7 @@ * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or write to the Free Software Foundation, Inc., + * or write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , * USA * @@ -2011,7 +2011,7 @@ Please submit test reports only with the test form at sourceforge. Three simple steps: - + Select category: the distribution you test on. Select group: the version of Privoxy that we are about to release. Fill the Summary and Detailed Description with something @@ -2021,7 +2021,7 @@ Do not mail to the mailing list (we cannot keep track on issues there). - + @@ -2049,7 +2049,7 @@ Version numbers - First you need to determine which version number the release will have. + First you need to determine which version number the release will have. Privoxy version numbers consist of three numbers, separated by dots, like in X.Y.Z (e.g. 3.0.0), where: @@ -2057,7 +2057,7 @@ X, the version major, is rarely ever changed. It is increased by one if turning a development branch into stable substantially changes the functionality, - user interface or configuration syntax. Majors 1 and 2 were + user interface or configuration syntax. Majors 1 and 2 were Junkbuster, and 3 will be the first stable Privoxy release. @@ -2081,7 +2081,7 @@ Z, the point or sub version, represents a release of the software within a branch. - It is therefore incremented immediately before each code freeze. + It is therefore incremented immediately before each code freeze. In development branches, only the even point versions correspond to actual releases, while the odd ones denote the evolving state of the sources on CVS in between. It follows that Z is odd on CVS in development branches most of the time. There, it gets @@ -2094,11 +2094,11 @@ Stable branches work a little differently, since there should be little to no development happening in such branches. Remember, only bugfixes, which presumably should have had some testing - before being committed. Stable branches will then have their - version reported as 0.0.0, during that period - between releases when changes are being added. This is to denote - that this code is not for release. Then - as the release nears, the version is bumped according: e.g. + before being committed. Stable branches will then have their + version reported as 0.0.0, during that period + between releases when changes are being added. This is to denote + that this code is not for release. Then + as the release nears, the version is bumped according: e.g. 3.0.1 -> 0.0.0 -> 3.0.2. @@ -2120,16 +2120,16 @@ before committing to a stable branch! - Developers should remember too that if they commit a bugfix to the stable - branch, this will more than likely require a separate submission to the - main trunk, since these are separate development trees within CVS. If you + Developers should remember too that if they commit a bugfix to the stable + branch, this will more than likely require a separate submission to the + main trunk, since these are separate development trees within CVS. If you are working on both, then this would require at least two separate check outs (i.e main trunk, and the stable release branch, which is v_3_0_branch at the moment). - + Before the Release: Freeze @@ -2145,26 +2145,26 @@ they have pending changes/fixes in their pipelines. Announce the freeze so that nobody will interfere with last minute changes. - + Increment the version number (point from odd to even in development - branches!) in configure.in. (RPM spec files + branches!) in configure.in. (RPM spec files will need to be incremented as well.) - + If default.action has changed since last release (i.e. software release or standalone actions file release), bump up its version info to A.B in this line: - + {+add-header{X-Actions-File-Version: A.B} -filter -no-popups} - + Then change the version info in doc/webserver/actions/index.php, line: '$required_actions_file_version = "A.B";' @@ -2172,36 +2172,36 @@ All documentation should be rebuild after the version bump. - Finished docs should be then be committed to CVS (for those - without the ability to build these). Some docs may require + Finished docs should be then be committed to CVS (for those + without the ability to build these). Some docs may require rather obscure processing tools. config, the man page (and the html version of the man page), and the PDF docs fall in this category. REAMDE, the man page, AUTHORS, and config - should all also be committed to CVS for other packagers. The + should all also be committed to CVS for other packagers. The formal docs should be uploaded to the webserver. See the Section "Updating the webserver" in this manual for details. - + - The User Manual is also used for context + The User Manual is also used for context sensitive help for the CGI editor. This is version sensitive, so that - the user will get appropriate help for his/her release. So with + the user will get appropriate help for his/her release. So with each release a fresh version should be uploaded to the webserver (this is in addition to the main User Manual - link from the main page since we need to keep manuals for various - versions available). The CGI pages will link to something like + link from the main page since we need to keep manuals for various + versions available). The CGI pages will link to something like http://privoxy.org/$(VERSION)/user-manual/. This will need to be updated for each new release. There is no Makefile target for this at this time!!! It needs to be done manually. - + All developers should look at the ChangeLog and make sure noteworthy changes are referenced. - + Commit all files that were changed in the above steps! @@ -2213,14 +2213,14 @@ cvs tag v_X_Y_Z. Don't use vX_Y_Z, ver_X_Y_Z, v_X.Y.Z (won't work) etc. - + If the release was in a development branch, increase the point version from even to odd (X.Y.(Z+1)) again in configure.in and commit your change. - + On the webserver, copy the user manual to a new top-level directory @@ -2228,27 +2228,27 @@ pages, which have the version as a prefix, will go into the right version of the manual. If this is a development branch release, also symlink X.Y.(Z-1) to X.Y.Z and X.Y.(Z+1) to - . (i.e. dot). + . (i.e. dot). - + - + - + Building and Releasing the Packages Now the individual packages can be built and released. Note that for GPL reasons the first package to be released is always the source tarball. - + For all types of packages, including the source tarball, you must make sure that you build from clean sources by exporting the right version from CVS into an empty directory (just press return when asked for a password): - + mkdir dist # delete or choose different name if it already exists @@ -2257,20 +2257,20 @@ cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa export -r v_X_Y_Z current - + Do NOT change a single bit, including, but not limited to version information after export from CVS. This is to make sure that all release packages, and with them, all future bug reports, are based on exactly the same code. - + - Every significant release of Privoxy has included at least one - package that either had incorrect versions of files, missing files, - or incidental leftovers from a previous build process that gave - unknown numbers of users headaches to try to figure out what was + Every significant release of Privoxy has included at least one + package that either had incorrect versions of files, missing files, + or incidental leftovers from a previous build process that gave + unknown numbers of users headaches to try to figure out what was wrong. PLEASE, make sure you are using pristene sources, and are following the prescribed process! @@ -2278,14 +2278,14 @@ Please find additional instructions for the source tarball and the - individual platform dependent binary packages below. And details + individual platform dependent binary packages below. And details on the Sourceforge release process below that. Note on Privoxy Packaging - Please keep these general guidelines in mind when putting together + Please keep these general guidelines in mind when putting together your package. These apply to all platforms! @@ -2293,11 +2293,11 @@ Privoxy requires - write access to: all *.action files, all - logfiles, and the trust file. You will + write access to: all *.action files, all + logfiles, and the trust file. You will need to determine the best way to do this for your platform. - + Please include up to date documentation. At a bare minimum: @@ -2343,11 +2343,11 @@ The documentation has been designed such that the manuals are linked - to each other from parallel directories, and should be packaged + to each other from parallel directories, and should be packaged that way. privoxy-index.html can also be included and can serve as a focal point for docs and other links of interest (and possibly renamed to index.html). - This should be one level up from the manuals. There is a link also + This should be one level up from the manuals. There is a link also on this page to an HTMLized version of the man page. To avoid 404 for this, it is in CVS as doc/webserver/man-page/privoxy-man-page.html, @@ -2357,16 +2357,16 @@ with privoxy-index.html, (i.e. one level up from the manual directories). - + user.action and user.filter are designed for local preferences. Make sure these do not get overwritten! - config should not be overwritten either. This + config should not be overwritten either. This has especially important configuration data in it. trust should be left in tact as well. - + Other configuration files (default.action and @@ -2376,29 +2376,29 @@ likely to change between releases and contain important new features and bug fixes. - + - Please check platform specific notes in this doc, if you haven't - done Privoxy packaging before for other platform - specific issues. Conversely, please add any notes that you know - are important for your platform (or contact one of the doc + Please check platform specific notes in this doc, if you haven't + done Privoxy packaging before for other platform + specific issues. Conversely, please add any notes that you know + are important for your platform (or contact one of the doc maintainers to do this if you can't). - + - Packagers should do a clean install of their - package after building it. So any previous installs should be - removed first to ensure the integrity of the newly built package. - Then run the package for a while to make sure there are no + Packagers should do a clean install of their + package after building it. So any previous installs should be + removed first to ensure the integrity of the newly built package. + Then run the package for a while to make sure there are no obvious problems, before uploading. - + - - + + Source Tarball @@ -2444,7 +2444,7 @@ First, make sure that you have freshly exported the right version into an empty directory. (See "Building and releasing - packages" above). + packages" above). As the only exception to not changing anything after export from CVS, @@ -2515,7 +2515,7 @@ Change directory to the os2setup directory. Edit the os2build.cmd file to set the final executable filename. - For example, + For example, @@ -2635,7 +2635,7 @@ - Then, run: + Then, run: @@ -2693,7 +2693,7 @@ - You can then upload privoxyosx_setup_x.y.z.zip anonymously to + You can then upload privoxyosx_setup_x.y.z.zip anonymously to uploads.sourceforge.net/incoming, create a release for it, and you're done. Use the release notes and Change Log from the source tarball package. @@ -2814,7 +2814,7 @@ Uploading and Releasing Your Package - After the package is ready, it is time to upload it + After the package is ready, it is time to upload it to SourceForge, and go through the release steps. The upload is done via FTP: @@ -2824,47 +2824,47 @@ Upload to: ftp://upload.sourceforge.net/incoming - + user: anonymous - + password: ijbswa-developers@lists.sourceforge.net - + - + Or use the make targets as described above. Once this done go to https://sourceforge.net/project/admin/editpackages.php?group_id=11118, - making sure you are logged in. Find your target platform in the - second column, and click Add Release. You will - then need to create a new release for your package, using the format + >https://sourceforge.net/project/admin/editpackages.php?group_id=11118, + making sure you are logged in. Find your target platform in the + second column, and click Add Release. You will + then need to create a new release for your package, using the format of $VERSION ($CODE_STATUS), e.g. &p-version; (beta). Now just follow the prompts. Be sure to add any appropriate Release - notes. You should see your freshly uploaded packages in - Step 2. Add Files To This Release. Check the - appropriate box(es). Remember at each step to hit the - Refresh/Submit buttons! You should now see your - file(s) listed in Step 3. Fill out the forms with the appropriate + notes. You should see your freshly uploaded packages in + Step 2. Add Files To This Release. Check the + appropriate box(es). Remember at each step to hit the + Refresh/Submit buttons! You should now see your + file(s) listed in Step 3. Fill out the forms with the appropriate information for your platform, being sure to hit Update - for each file. If anyone is monitoring your platform, check the - email box at the very bottom to notify them of + for each file. If anyone is monitoring your platform, check the + email box at the very bottom to notify them of the new package. This should do it! - If you have made errors, or need to make changes, you can go through - essentially the same steps, but select Edit Release, + If you have made errors, or need to make changes, you can go through + essentially the same steps, but select Edit Release, instead of Add Release. @@ -2878,20 +2878,20 @@ include the download location, the release notes and the Changelog. Also, post an - updated News item on the project page Sourceforge, and update the Home + updated News item on the project page Sourceforge, and update the Home page and docs linked from the Home page (see below). Other news sites and release oriented sites, such as Freshmeat, should also be notified. - + Update the Webserver The webserver should be updated at least with each stable release. When updating, please follow these steps to make sure that no broken links, - inconsistent contents or permission problems will occur (as it has many + inconsistent contents or permission problems will occur (as it has many times in the past!): @@ -2906,7 +2906,7 @@ That will generate doc/webserver/user-manual, doc/webserver/developer-manual, - doc/webserver/faq, + doc/webserver/faq, doc/pdf/*.pdf and doc/webserver/index.html automatically. @@ -2923,7 +2923,7 @@ create new directories under doc/webserver). - Next, commit any changes from the above steps to CVS. All set? + Next, commit any changes from the above steps to CVS. All set? If these are docs in the stable branch, then do: @@ -2950,7 +2950,7 @@ &contacting; - + Privoxy Copyright, License and History @@ -2975,7 +2975,7 @@ - + See also @@ -2986,7 +2986,7 @@ - Copyright &my-copy; 2001-2010 by + Copyright &my-copy; 2001-2011 by Privoxy Developers -$Id: faq.sgml,v 2.75 2010/11/13 10:08:00 fabiankeil Exp $ +$Id: faq.sgml,v 2.85 2011/12/26 17:05:40 fabiankeil Exp $ +--> @@ -137,7 +137,7 @@ You can find the latest version of the document at http://www.privoxy.org/faq/. Please see the Contact section if you want to - contact the developers. + contact the developers. @@ -152,7 +152,7 @@ General Information Who should give &my-app; a try? - Anyone who is interested in security, privacy, or in + Anyone who is interested in security, privacy, or in finer-grained control over their web and Internet experience. @@ -160,7 +160,7 @@ Is Privoxy the best choice for me? - &my-app; is certainly a good choice, especially for those who want more + &my-app; is certainly a good choice, especially for those who want more control and security. Those with the willingness to read the documentation and the ability to fine-tune their installation will benefit the most. @@ -170,19 +170,19 @@ completely personalize your installation. Being familiar with, or at least having an interest in learning about HTTP and other networking - protocols, HTML, and + protocols, HTML, and Regular Expressions - will be a big plus and will help you get the most out of &my-app;. - A new installation just includes a very basic configuration. The user - should take this as a starting point only, and enhance it as he or she - sees fit. In fact, the user is encouraged, and expected to, fine-tune the + will be a big plus and will help you get the most out of &my-app;. + A new installation just includes a very basic configuration. The user + should take this as a starting point only, and enhance it as he or she + sees fit. In fact, the user is encouraged, and expected to, fine-tune the configuration. - Much of Privoxy's configuration can be done + Much of Privoxy's configuration can be done with a Web browser. - But there are areas where configuration is done using a + But there are areas where configuration is done using a text editor to edit configuration files. Also note that the web-based action editor doesn't use authentication and should only be enabled in environments @@ -220,13 +220,13 @@ Does Privoxy do anything more than ad blocking? - - Yes, ad blocking is but one possible use. There are many, many ways &my-app; - can be used to sanitize and customize web browsing. + + Yes, ad blocking is but one possible use. There are many, many ways &my-app; + can be used to sanitize and customize web browsing. -What is this new version of +<sect2 renderas="sect3" id="newjb"><title>What is this new version of <quote><citetitle>Junkbuster</citetitle></quote>? @@ -247,20 +247,20 @@ led to confusion. - There are also potential legal complications from our use of the - Junkbuster name, which is a registered trademark of + There are also potential legal complications from our use of the + Junkbuster name, which is a registered trademark of Junkbusters Corporation. - There are, however, no objections from Junkbusters Corporation to the + There are, however, no objections from Junkbusters Corporation to the Privoxy project itself, and they, in fact, still share our ideals and goals. - The developers also believed that there are so many improvements over the original - code, that it was time to make a clean break from the past and make + The developers also believed that there are so many improvements over the original + code, that it was time to make a clean break from the past and make a name in their own right. - Privoxy is the + Privoxy is the Privacy Enhancing Proxy. Also, its content modification and junk suppression gives you, the user, more control, more freedom, and allows you to browse your personal and @@ -269,7 +269,7 @@ How does Privoxy differ -from the old Junkbuster? +from the old Junkbuster? Privoxy picks up where Junkbuster left off. @@ -283,7 +283,7 @@ Privoxy's new features include: - + &newfeatures; @@ -302,7 +302,7 @@ and the host (blocking the big banner hosting services like doublecklick.net already helps a lot). Privoxy takes advantage of this fact by using URL - patterns to sort out and block the requests for things that sound + patterns to sort out and block the requests for things that sound like they would be ads or banners. @@ -320,7 +320,7 @@ -Can Privoxy make mistakes? +<title id="mistakes">Can Privoxy make mistakes? This does not sound very scientific. Actually, it's a black art ;-) And yes, it is always possible to have a broad @@ -347,12 +347,12 @@ The default installation should give you a good starting point, and block most ads and unwanted content, but many of the more advanced features are off by default, and require - you to activate them. + you to activate them. You do have to set up your browser to use Privoxy (see the Installation section below). + linkend="firststep">Installation section below). And you will certainly run into situations where there are false positives, @@ -367,7 +367,7 @@ Can Privoxy run as a server on a network? - + Yes, &my-app; runs as a server already, and can easily be configured to serve more than one client. See How can I set up Privoxy to act as a proxy for my LAN below. @@ -384,8 +384,8 @@ your browser just can't. - In addition, a proxy is good choice if you use multiple browsers, or - have a LAN with multiple computers since &my-app; can run as a server + In addition, a proxy is good choice if you use multiple browsers, or + have a LAN with multiple computers since &my-app; can run as a server application. This way all the configuration is in one place, and you don't have to maintain a similar configuration for possibly many browsers or users. @@ -404,8 +404,8 @@ The most important reason is because you have access to everything, and you can control everything. You can check every line of every configuration file yourself. You can check every - last bit of source code should you desire. And even if you can't read code, - there should be some comfort in knowing that other people can, + last bit of source code should you desire. And even if you can't read code, + there should be some comfort in knowing that other people can, and do read it. You can build the software from scratch, if you want, so that you know the executable is clean, and that it is yours. In fact, we encourage this level of scrutiny. It @@ -413,14 +413,14 @@ -Is there is a license or fee? What about a +<sect2 renderas="sect3" id="license"><title>Is there is a license or fee? What about a warranty? Registration? Privoxy is free software and licensed under the GNU General Public License (GPL) version 2. It is free to use, copy, modify or distribute as you wish under the terms of this license. Please see the Copyright section for more - information on the license and copyright. Or the LICENSE file + information on the license and copyright. Or the LICENSE file that should be included. @@ -506,37 +506,60 @@ Privoxy is developed by unpaid volunteers and thus our current running costs are pretty low. Nevertheless, we - have plans that will cost money in the future. We would like to get - this money through donations made by our users. + have plans that will cost money in the future. They include, + but aren't limited to spending money on: + - Privoxy has therefore become an associated - project of Software - in the Public Interest (SPI), which allows us to receive tax-deductible - donations in most western countries. + + + + Hardware to help make sure Privoxy + keeps running on platforms the developers currently can't test + on and can be ported to others. + + + + + Technical books to educate our developers about said platforms + or to improve their knowledge in general. + + + + + More reliable hosting, + + + - We intend to use the donations to pay for our domain after transfering - it to SPI. Our goal is to make sure there's no single point of failure - and the bill gets paid and the site keeps running even if a some of - the currently active developers were to suddenly disappear for a while. + We would like to get this money through donations made by our users. - We would also like to spend some money on more reliable hosting, - on hardware to help make sure Privoxy - keeps running on platforms the developers currently can't test on, - and on technical books to educate our developers about said platforms - or to improve their knowledge in general. + Privoxy has therefore become an associated + project of Software + in the Public Interest (SPI), which allows us to receive donations. + In the United States they are tax-deductible, in a few other western countries + they might be tax-deductible in the future. + + + + If you read this section before you may notice that paying for the + project domain privoxy.org is no longer on the list. It has been + transferred to SPI is sponsored by Mythic Beasts Ltd. If you enjoy our software and feel like helping out with a donation, please have a look at SPI's donation page - to see what the options are. + to see what the options are. If you have any questions regarding donations + please mail to either the public user mailing list or, if it's a private + matter, to Fabian Keil + (Privoxy's SPI liason) directly. @@ -552,10 +575,10 @@ Which browsers are supported by Privoxy? - Any browser that can be configured to use a proxy, which + Any browser that can be configured to use a proxy, which should be virtually all browsers, including Firefox, Internet - Explorer, Opera, and + Explorer, Opera, and Safari among others. Direct browser support is not an absolute requirement since Privoxy runs as a separate application and talks @@ -581,7 +604,7 @@ dealing with some of the common abuses of HTML in email. See How can I configure Privoxy with Outlook? below for more on - this. + this. Be aware that HTML email presents a number of unique security and privacy @@ -592,11 +615,11 @@ -I just installed Privoxy. Is there anything +<title>I just installed Privoxy. Is there anything special I have to do now? - All browsers should be told to use Privoxy - as a proxy by specifying the correct proxy address and port number + All browsers should be told to use Privoxy + as a proxy by specifying the correct proxy address and port number in the appropriate configuration area for the browser. It's possible to combine &my-app; with a packet filter to intercept HTTP requests even if the client isn't explicitly configured to use &my-app;, - but where possible, configuring the client is recommended. See + but where possible, configuring the client is recommended. See the User Manual for more details. You should also flush your browser's memory and disk - cache to get rid of any cached junk items, and remove any stored + cache to get rid of any cached junk items, and remove any stored cookies. @@ -636,7 +659,7 @@ If you set up the Privoxy to run on the computer you browse from (rather than your ISP's server or some - networked computer on a LAN), the proxy will be on 127.0.0.1 + networked computer on a LAN), the proxy will be on 127.0.0.1 (sometimes referred to as localhost, which is the special name used by every computer on the Internet to refer to itself) and the port will be 8118 (unless you used the localhost or the IP address 127.0.0.1 in the boxes next to HTTP and Secure (HTTPS) and - then the number 8118 for port. + then the number 8118 for port. This tells your browser to send all web requests to Privoxy instead of directly to the Internet. - Privoxy can also be used to proxy for - a Local Area Network. In this case, your would enter either the IP - address of the LAN host where Privoxy + Privoxy can also be used to proxy for + a Local Area Network. In this case, your would enter either the IP + address of the LAN host where Privoxy is running, or the equivalent hostname, e.g. 192.168.1.1. Port assignment would be same as above. Note that Privoxy doesn't listen on any LAN interfaces by @@ -672,17 +695,17 @@ All the ads are there. What's wrong? - Did you configure your browser to use Privoxy + Did you configure your browser to use Privoxy as a proxy? It does not sound like it. See above. You might also try flushing - the browser's caches to force a full re-reading of pages. You can verify - that Privoxy is running, and your browser - is correctly configured by entering the special URL: - http://p.p/. + the browser's caches to force a full re-reading of pages. You can verify + that Privoxy is running, and your browser + is correctly configured by entering the special URL: + http://p.p/. This should take you to a page titled This is Privoxy.. with access to Privoxy's internal configuration. - If you see this, then you are good to go. If you receive a page saying + If you see this, then you are good to go. If you receive a page saying Privoxy is not running, then the browser is not set up to use your Privoxy installation. If you receive anything else (probably nothing at all), it could either @@ -721,7 +744,7 @@ The procedure for clearing the cache varies from browser to browser. For - example, Mozilla/Netscape users would click + example, Mozilla/Netscape users would click Edit --> Preferences --> Advanced --> Cache and then click both Clear Memory Cache @@ -745,7 +768,7 @@ &my-app; utilizes the concept of - actions + actions that are used to manipulate and control web page data. Actions files are where these actions @@ -755,7 +778,7 @@ There is a wide array of actions available that give the user a high degree of control and flexibility on how to process each and every web page. - + Actions can be defined on a URL pattern basis, i.e. @@ -771,7 +794,7 @@ -The <quote>actions</quote> concept confuses me. Please list +<title>The <quote>actions</quote> concept confuses me. Please list some of these <quote>actions</quote>. For a comprehensive discussion of the actions concept, please refer @@ -787,7 +810,7 @@ How are actions files configured? What is the easiest -way to do this? +way to do this? Actions files are just text files in a special syntax and can be edited @@ -796,8 +819,8 @@ at http://config.privoxy.org/ (Shortcut: http://p.p/) and then select View & - change the current configuration from the menu. Note - that this feature must be explicitly enabled in the main config file + change the current configuration from the menu. Note + that this feature must be explicitly enabled in the main config file (see enable-edit-actions). @@ -816,7 +839,7 @@ Where can I get updated Actions Files? - Based on your feedback and the continuing development, updates of + Based on your feedback and the continuing development, updates of default.action will be made available from time to time on the files section of @@ -845,21 +868,21 @@ Why is the configuration so complicated? - Complicated is in the eye of the beholder. Those that are + Complicated is in the eye of the beholder. Those that are familiar with some of the underlying concepts, such as regular expression syntax, take to it like a fish takes to water. Also, software that tries hard to be user friendly, often lacks sophistication and flexibility. There is always that trade-off there between power vs. easy-of-use. Furthermore, anyone is welcome to contribute ideas and - implementations to enhance &my-app;. + implementations to enhance &my-app;. How can I make my Yahoo/Hotmail/Gmail account work? The default configuration shouldn't impact the usability of any of these services. - It may, however, make all cookies + It may, however, make all cookies temporary, so that your browser will forget your login credentials in between browser sessions. If you would like not to have to log in manually each time you access those websites, simply turn off all cookie handling @@ -873,9 +896,9 @@ .login.yahoo.com - These kinds of sites are often quite complex and heavy with - Javascript and - thus fragile. So if still a problem, + These kinds of sites are often quite complex and heavy with + Javascript and + thus fragile. So if still a problem, we have an alias just for such sticky situations: @@ -893,8 +916,8 @@ Make sure the domain, host and path are appropriate as well. Your browser can - tell you where you are specifically and you should use that information for - your configuration settings. Note that above it is not referenced as + tell you where you are specifically and you should use that information for + your configuration settings. Note that above it is not referenced as gmail.com, which is a valid domain name. @@ -908,7 +931,7 @@ profiles in the web based actions file editor at http://config.privoxy.org/show-status. See the User - Manual for a list of actions, and how the default + Manual for a list of actions, and how the default profiles are set. @@ -916,23 +939,23 @@ Where the defaults are likely to break some sites, exceptions for known popular problem sites are included, but in general, the more aggressive your default settings are, the more exceptions - you will have to make later. New users are best to start off in - Cautious setting. This is safest and will have the fewest + you will have to make later. New users are best to start off in + Cautious setting. This is safest and will have the fewest problems. See the User Manual for a more detailed discussion. - It should be noted that the Advanced profile (formerly known + It should be noted that the Advanced profile (formerly known as the Adventuresome profile) is more - aggressive, and will make use of some of + aggressive, and will make use of some of Privoxy's advanced features. Use at your own risk! - Why can I change the configuration +<sect2 renderas="sect3" id="browseconfig"> <title>Why can I change the configuration with a browser? Does that not raise security issues? It may seem strange that regular users can edit the config files with their @@ -948,7 +971,7 @@ If you run Privoxy for multiple untrusted users (e.g. in a LAN) or aren't entirely in control of your own browser, you will probably want - to make sure that the the web-based editor and remote toggle features are + to make sure that the web-based editor and remote toggle features are off by setting enable-edit-actions 0 and - If you are familiar with regular expressions, and HTML, you can look at + If you are familiar with regular expressions, and HTML, you can look at the provided default.filter with a text editor and define your own filters. This is potentially a very powerful feature, but - requires some expertise in both regular expressions and HTML/HTTP. - user.filter, so they won't - be overwritten during upgrades. - The ability to define multiple filter files + requires some expertise in both regular expressions and HTML/HTTP. + user.filter, so they won't + be overwritten during upgrades. + The ability to define multiple filter files in config is a new feature as of v. 3.0.5.]]> - There is no GUI editor option for this part of the configuration, - but you can disable/enable the various pre-defined filters of the included + There is no GUI editor option for this part of the configuration, + but you can disable/enable the various pre-defined filters of the included default.filter file with the web-based actions file editor. Note that the custom actions editor must be explicitly enabled in @@ -1021,10 +1044,10 @@ -How can I set up Privoxy to act as a proxy for my +<title>How can I set up Privoxy to act as a proxy for my LAN? - By default, Privoxy only responds to requests + By default, Privoxy only responds to requests from 127.0.0.1 (localhost). To have it act as a server for a network, this needs to be changed in the main configuration file. Look for @@ -1043,12 +1066,12 @@ - Save the file, and restart Privoxy. Configure + Save the file, and restart Privoxy. Configure all browsers on the network then to use this address and port number. - Alternately, you can have Privoxy listen on + Alternately, you can have Privoxy listen on all available interfaces: @@ -1058,10 +1081,10 @@ - And then use Privoxy's + And then use Privoxy's permit-access - feature to limit connections. A firewall in this situation is recommended + url="../user-manual/config.html#PERMIT-ACCESS">permit-access + feature to limit connections. A firewall in this situation is recommended as well. @@ -1096,7 +1119,7 @@ If you want to see nothing, then change the set-image-blocker - action to blank. This can be done by editing the + action to blank. This can be done by editing the user.action file, or through the web-based actions file editor. @@ -1111,7 +1134,7 @@ is rather smart, it will make occasional mistakes. The checkerboard image is visually decent, and it shows you where images have been blocked, which can be very helpful in case some navigation aid or otherwise innocent image was - erroneously blocked. It is recommended for new users so they can + erroneously blocked. It is recommended for new users so they can see what is happening. Some people might also enjoy seeing how many banners they don't have to see. @@ -1127,7 +1150,7 @@ or (i)layers, and these external HTML documents are blocked. Being non-images they get replaced by a substitute HTML page rather than a substitute image, which wouldn't work out technically, since the browser expects and accepts - only HTML when it has requested an HTML document. + only HTML when it has requested an HTML document. The substitute page adapts to the available space and shows itself as a @@ -1146,15 +1169,15 @@ -Can Privoxy run as a service +<title>Can Privoxy run as a service on Win2K/NT/XP? Windows service functionality. See - the User Manual for details on how to install and configure + the User Manual for details on how to install and configure Privoxy as a service. - + Earlier ]]>3.x versions could run as a system service using srvany.exe. See the discussion at - No, its more complicated than that. This only works with special kinds + No, its more complicated than that. This only works with special kinds of proxies known as intercepting proxies (see below). @@ -1215,7 +1238,7 @@ but it can handle requests that where intercepted and redirected with a packet filter (like PF or iptables), as long as the Host - header is present. + header is present. As the Host header is required by HTTP/1.1 and as most @@ -1256,14 +1279,14 @@ of knowing which particular application makes a request, so there is no way to distinguish between web pages and HTML mail. Privoxy just blindly proxies all requests. In the - case of Outlook Express (see above), OE uses - IE anyway, and there is no way for Privoxy to ever + case of Outlook Express (see above), OE uses + IE anyway, and there is no way for Privoxy to ever be able to distinguish between them (nor could any other proxy type application for that matter). - For a good discussion of some of the issues involved (including privacy and - security issues), see + For a good discussion of some of the issues involved (including privacy and + security issues), see http://sourceforge.net/tracker/?func=detail&atid=211118&aid=629518&group_id=11118. @@ -1272,12 +1295,12 @@ I sometimes notice cookies sneaking through. How? Cookies can be - set in several ways. The classic method is via the + url="http://en.wikipedia.org/wiki/Browser_cookie">Cookies can be + set in several ways. The classic method is via the Set-Cookie HTTP header. This is straightforward, and an - easy one to manipulate, such as the &my-app; concept of + easy one to manipulate, such as the &my-app; concept of session-cookies-only. - There is also the possibility of using + There is also the possibility of using Javascript to set cookies (&my-app; calls these content-cookies). This is trickier because the syntax can vary widely, and thus requires a certain @@ -1296,20 +1319,20 @@ Are all cookies bad? Why? - No, in fact there are many beneficial uses of + No, in fact there are many beneficial uses of cookies. Cookies are just a method that browsers can use to store data between pages, or between browser sessions. Sometimes there is a good reason for this, and the user's life is a bit easier as a result. But there is a long history of some websites taking - advantage of this layer of trust, and using the data they glean from you and + advantage of this layer of trust, and using the data they glean from you and your browsing habits for their own purposes, and maybe to your potential detriment. Such sites are using you and storing their data on your system. That is why the privacy conscious watch from whom those cookies come, and why they really need to be there. - See the + See the Wikipedia cookie definition for more. @@ -1319,14 +1342,14 @@ How can I allow permanent cookies for my trusted sites? - There are several actions that relate to cookies. The default behavior is to + There are several actions that relate to cookies. The default behavior is to allow only session cookies, which means the cookies only last - for the current browser session. This eliminates most kinds of abuse related + for the current browser session. This eliminates most kinds of abuse related to cookies. But there may be cases where you want cookies to last. To disable all cookie actions, so that cookies are allowed unrestricted, - both in and out, for example.com: + both in and out, for example.com: @@ -1347,14 +1370,14 @@ Each instance of Privoxy has its own configuration, including such attributes as the TCP port that it listens on. - What you can do is run multiple instances of Privoxy, each with - a unique + What you can do is run multiple instances of Privoxy, each with + a unique listen-address configuration setting, and configuration path, and then each of these can have their own configurations. Think of it as per-port configuration. - + Simple enough for a few users, but for large installations, consider having groups of users that might share like configurations. @@ -1373,7 +1396,7 @@ ############################################################ { +block } / # Block *all* URLs - + ############################################################ # Whitelist ############################################################ @@ -1382,12 +1405,12 @@ toys.example.com games.example.com - This allows access to only those three sites by first blocking all URLs, and + This allows access to only those three sites by first blocking all URLs, and then subsequently allowing three specific exceptions. - Another approach is Privoxy's - trustfile concept, which incorporates the notion of + Another approach is Privoxy's + trustfile concept, which incorporates the notion of trusted referrers. See the Trust documentation for details. @@ -1404,14 +1427,14 @@ How can I turn off ad-blocking? - Ad blocking is achieved through a complex application of various &my-app; - actions. These - actions are deployed against simple images, banners, flash animations, + Ad blocking is achieved through a complex application of various &my-app; + actions. These + actions are deployed against simple images, banners, flash animations, text pages, JavaScript, pop-ups and pop-unders, etc., so its not as simple as just turning one or two actions off. The various actions that make up &my-app; ad blocking are hard-coded into the default configuration files. It has been assumed that everyone using &my-app; is interested in this - particular feature. + particular feature. If you want to do without this, there are several approaches you can take: @@ -1421,7 +1444,7 @@ blocking rules, and corresponding exceptions. Or lastly, if you are not concerned about the additional blocks that are done for privacy reasons, you can very easily over-ride all blocking with the - following very simple rule in your user.action: + following very simple rule in your user.action: @@ -1429,7 +1452,7 @@ { -block } / # UN-Block *all* URLs - + Or even a more comprehensive reversing of various ad related actions: @@ -1451,7 +1474,7 @@ -How can I have custom template pages, like the +<title>How can I have custom template pages, like the <emphasis>BLOCKED</emphasis> page? &my-app; templates are specialized text files utilized by @@ -1465,12 +1488,12 @@ during upgrades. You can, however, create completely new templates, place them in another directory and specify the alternate path in the main config. For details, have a look at the templdir option. + url="../user-manual/config.html#templdir">templdir option. -How can I remove the <quote>Go There Anyway</quote> link from +<title>How can I remove the <quote>Go There Anyway</quote> link from the <emphasis>BLOCKED</emphasis> page? There is more than one way to do it (although Perl is not involved). @@ -1479,7 +1502,7 @@ Editing the BLOCKED template page (see above) may dissuade some users, but this method is easily circumvented. Where you need this level of control, you might want to build &my-app; from source, and disable various features that are - available as compile-time options. You should + available as compile-time options. You should configure the sources as follows: @@ -1509,15 +1532,15 @@ Miscellaneous -How much does Privoxy slow my browsing down? This +<title id="slowsme">How much does Privoxy slow my browsing down? This has to add extra time to browsing. How much of an impact depends on many things, including the CPU of the host - system, how aggressive the configuration is, which specific actions are being triggered, + system, how aggressive the configuration is, which specific actions are being triggered, the size of the page, the bandwidth of the connection, etc. - Overall, it should not slow you down any in real terms, and may actually help + Overall, it should not slow you down any in real terms, and may actually help speed things up since ads, banners and other junk are not typically being retrieved and displayed. The actual processing time required by Privoxy itself for each page, is relatively small @@ -1555,7 +1578,7 @@ url="../user-manual/actions-file.html#FILTER">filter action, such as filtering banners by size, web-bugs etc, or the deanimate-gifs - action, the entire document must be loaded into memory in order for the filtering + action, the entire document must be loaded into memory in order for the filtering mechanism to work, and nothing is sent to the browser during this time. @@ -1569,7 +1592,7 @@ anti-virus software). - Filtering is automatically disabled for inappropriate MIME types. But note + Filtering is automatically disabled for inappropriate MIME types. But note that if the web server mis-reports the MIME type, then content that should not be filtered, could be. Privoxy only knows how to differentiate filterable content because of the MIME type as reported by @@ -1582,11 +1605,11 @@ "http://p.p/"? http://config.privoxy.org/ is the - address of Privoxy's built-in user interface, and + address of Privoxy's built-in user interface, and http://p.p/ is a shortcut for it. - Since Privoxy sits between your web browser and the Internet, + Since Privoxy sits between your web browser and the Internet, it can simply intercept requests for these addresses and answer them with its built-in web server. @@ -1607,7 +1630,7 @@ Do you still maintain the blocklists? No. The patterns for blocking now reside (among other things) in the actions files, which are + url="../user-manual/actions-file.html">actions files, which are actively maintained instead. See next question ... @@ -1621,25 +1644,25 @@ -If I do submit missed ads, will +<sect2 renderas="sect3" id="newads2"><title>If I do submit missed ads, will they be included in future updates? Whether such submissions are eventually included in the - default.action configuration file depends on how - significant the issue is. We of course want to address any potential - problem with major, high-profile sites such as Google, - Yahoo, etc. Any site with global or regional reach, + default.action configuration file depends on how + significant the issue is. We of course want to address any potential + problem with major, high-profile sites such as Google, + Yahoo, etc. Any site with global or regional reach, has a good chance of being a candidate. But at the other end of the spectrum are any number of smaller, low-profile sites such as for local clubs or schools. Since their reach and impact are much less, they are best handled by inclusion in the user's user.action, and thus would be - unlikely to be included. + unlikely to be included. -Why doesn't anyone answer my support +<sect2 renderas="sect3" id="noonecares"><title>Why doesn't anyone answer my support request? Rest assured that it has been read and considered. Why it is not answered, @@ -1657,7 +1680,7 @@ If you run both the browser and &my-app; locally, you cannot hide your IP address with Privoxy or ultimately any other software alone. The server needs to know your IP address so that it knows - where to send the responses back. + where to send the responses back. There are many publicly usable "anonymous" proxies out there, which @@ -1693,8 +1716,8 @@ Privoxy can remove various information about you, - and allows you more freedom to decide which sites - you can trust, and what details you want to reveal. But it neither + and allows you more freedom to decide which sites + you can trust, and what details you want to reveal. But it neither hides your IP address, nor can it guarantee that the rest of the system behaves correctly. There are several possibilities how a web sites can find out who you are, even if you are using a strict Privoxy @@ -1744,7 +1767,7 @@ 5. Startup to make sure Privoxy itself is setup correctly. - + If it is, refer to Tor's extensive documentation to learn how to install Tor, and make sure Tor's logfile says that @@ -1763,7 +1786,7 @@ If you verified that Privoxy and Tor are working, it is time to connect them. As far as Privoxy is concerned, Tor is just another proxy that can be reached - by socks4 or socks4a. Most likely you are interested in Tor + by socks4, socks4a and socks5. Most likely you are interested in Tor to increase your anonymity level, therefore you should use socks5, to make sure DNS requests are done through Tor and thus invisible to your local network. Using socks4a would work too, but with socks5 you get more precise error @@ -1838,7 +1861,7 @@ content is being altered? - Definitely. It is common for sites to use browser type, browser version, + Definitely. It is common for sites to use browser type, browser version, HTTP header content, and various other techniques in order to dynamically decide what to display and how to display it. What you see, and what I see, might be very different. There are many, many ways that this can be handled, @@ -1864,8 +1887,8 @@ many other ways things can go wrong when trying to fool a web server. The results of which could inadvertently cause pages to load incorrectly, partially, or even not at all. And there may be no obvious clues as to just - what went wrong, or why. Nowhere will there be a message that says - Turn off fast-redirects or else! + what went wrong, or why. Nowhere will there be a message that says + Turn off fast-redirects or else! @@ -1875,8 +1898,8 @@ - If you have problems with a site, you will have to adjust your configuration - accordingly. Cookies are probably the most likely adjustment that may + If you have problems with a site, you will have to adjust your configuration + accordingly. Cookies are probably the most likely adjustment that may be required, but by no means the only one. @@ -1884,13 +1907,13 @@ -Can Privoxy act as a <quote>caching</quote> proxy to +<title id="caching">Can Privoxy act as a <quote>caching</quote> proxy to speed up web browsing? - No, it does not have this ability at all. You want something like + No, it does not have this ability at all. You want something like Squid or Polipo for this. - And, yes, before you ask, Privoxy can co-exist + And, yes, before you ask, Privoxy can co-exist with other kinds of proxies like Squid. See the forwarding chapter in the user @@ -1901,7 +1924,7 @@ What about as a firewall? Can Privoxy protect me? - Not in the way you mean, or in the way some firewall vendors claim they can. + Not in the way you mean, or in the way some firewall vendors claim they can. Privoxy can help protect your privacy, but can't protect your system from intrusion attempts. It is, of course, perfectly possible to use both. @@ -1913,10 +1936,10 @@ ads used to be. Why? It is technically possible to eliminate banners and ads in a way that frees - their allocated page space. This could easily be done by blocking with + their allocated page space. This could easily be done by blocking with Privoxy's filters, and eliminating the entire image references from the - HTML page source. + HTML page source. But, this would consume considerably more CPU resources (IOW, slow things @@ -1955,35 +1978,35 @@ As far as ad blocking is concerned, this is less of a restriction than it may seem, since ad sources are often identifiable by the host name, and often the banners to be placed in an encrypted page come unencrypted nonetheless - for efficiency reasons, which exposes them to the full power of + for efficiency reasons, which exposes them to the full power of Privoxy's ad blocking. Content cookies (those that are embedded in the actual HTML or JS page content, see filter{content-cookies}), - in an SSL transaction will be impossible to block under these conditions. - Fortunately, this does not seem to be a very common scenario since most + url="../user-manual/actions-file.html#FILTER-CONTENT-COOKIES">filter{content-cookies}), + in an SSL transaction will be impossible to block under these conditions. + Fortunately, this does not seem to be a very common scenario since most cookies come by traditional means. -Privoxy runs as a <quote>server</quote>. How +<title id="secure">Privoxy runs as a <quote>server</quote>. How secure is it? Do I need to take any special precautions? - On Unix-like systems, Privoxy can run as a non-privileged + On Unix-like systems, Privoxy can run as a non-privileged user, which is how we recommend it be run. Also, by default Privoxy listens to requests from localhost only. - The server aspect of Privoxy is not itself directly + The server aspect of Privoxy is not itself directly exposed to the Internet in this configuration. If you want to have Privoxy serve as a LAN proxy, this will have to be opened up to allow for LAN requests. In this case, we'd recommend - you specify only the LAN gateway address, e.g. 192.168.1.1, in the main + you specify only the LAN gateway address, e.g. 192.168.1.1, in the main Privoxy configuration file and check all access control and security options. All LAN hosts can then use this as their proxy address @@ -2006,23 +2029,23 @@ url="http://config.privoxy.org/toggle">http://config.privoxy.org/toggle. - See the Bookmarklets section - of the User Manual for an easy way to access this - feature. Note that this is a feature that may need to be enabled in the main + See the Bookmarklets section + of the User Manual for an easy way to access this + feature. Note that this is a feature that may need to be enabled in the main config file. -When <quote>disabled</quote> is Privoxy totally +<title>When <quote>disabled</quote> is Privoxy totally out of the picture? No, this just means all optional filtering and actions are disabled. - Privoxy is still acting as a proxy, but just + Privoxy is still acting as a proxy, but just doing less of the things that Privoxy would - normally be expected to do. It is still a middle-man in - the interaction between your browser and web sites. See below to bypass + normally be expected to do. It is still a middle-man in + the interaction between your browser and web sites. See below to bypass the proxy. @@ -2038,10 +2061,10 @@ -My logs show Privoxy <quote>crunches</quote> +<title>My logs show Privoxy <quote>crunches</quote> ads, but also its own internal CGI pages. What is a <quote>crunch</quote>? - A crunch simply means Privoxy intercepted + A crunch simply means Privoxy intercepted something, nothing more. Often this is indeed ads or banners, but Privoxy uses the same mechanism for trapping requests for its own internal pages. For instance, a request for @@ -2065,7 +2088,7 @@ viewing a document (i.e. a page), and downloading a file. The same is true of Privoxy. If there is a match for a block pattern, - it will still be blocked, and of course this is obvious. + it will still be blocked, and of course this is obvious. Filtering is potentially more of a concern since the results are not always @@ -2092,7 +2115,7 @@ altered by filtering, will be saved too, for these (probably rare) cases. - Note that versions later than 3.0.2 do NOT filter document types reported as + Note that versions later than 3.0.2 do NOT filter document types reported as text/plain. Prior to this, Privoxy did filter this document type. @@ -2114,7 +2137,7 @@ all to the content is to be avoided. - Privoxy does not do FTP at all, only HTTP + Privoxy does not do FTP at all, only HTTP and HTTPS (SSL) protocols. @@ -2131,18 +2154,18 @@ Should I continue to use a <quote>HOSTS</quote> file for ad-blocking? One time-tested technique to defeat common ads is to trick the local DNS - system by giving a phony IP address for the ad generator in the local - HOSTS file, typically using 127.0.0.1, aka + system by giving a phony IP address for the ad generator in the local + HOSTS file, typically using 127.0.0.1, aka localhost. This effectively blocks the ad. - There is no reason to use this technique in conjunction with + There is no reason to use this technique in conjunction with Privoxy. Privoxy - does essentially the same thing, much more elegantly and with much more + does essentially the same thing, much more elegantly and with much more flexibility. A large HOSTS file, in fact, not only duplicates effort, but may get in the way and seriously slow down your system. - It is recommended to remove such entries from your HOSTS file. If you think - your hosts list is neglected by Privoxy's + It is recommended to remove such entries from your HOSTS file. If you think + your hosts list is neglected by Privoxy's configuration, consider adding your list to your user.action file: @@ -2164,15 +2187,15 @@ -I've noticed that Privoxy changes <quote>Microsoft</quote> to +<title>I've noticed that Privoxy changes <quote>Microsoft</quote> to <quote>MicroSuck</quote>! Why are you manipulating my browsing? @@ -2193,7 +2216,7 @@ Privoxy generates HTML in both its own templates, and possibly whenever there are text substitutions via a &my-app; filter. While this should always conform to the HTML 4.01 specifications, it has not been - validated against this or any other standard. + validated against this or any other standard. @@ -2251,7 +2274,7 @@ -Privoxy is not running. Solution: verify +Privoxy is not running. Solution: verify that &my-app; is installed correctly, has not crashed, and is indeed running. Turn on Privoxy's logging, and look at the logs to see what they say. @@ -2264,7 +2287,7 @@ configuration and take the forwarders out of the equation. - Or you have a firewall that is interfering and blocking you. Solution: + Or you have a firewall that is interfering and blocking you. Solution: try disabling or removing the firewall as a simple test. @@ -2285,7 +2308,7 @@ -I just added a new rule, but the steenkin ad is +<title id="flushit">I just added a new rule, but the steenkin ad is still getting through. How? If the ad had been displayed before you added its URL, it will probably be @@ -2299,16 +2322,16 @@ applied. Try pasting the full URL of the offending ad into http://config.privoxy.org/show-url-info and see if it really matches your new rule. Blocking ads is like blocking - spam: a lot of tinkering is required to stay ahead of the game. And - remember you need to block the URL of the ad in question, which may be + spam: a lot of tinkering is required to stay ahead of the game. And + remember you need to block the URL of the ad in question, which may be entirely different from the site URL itself. Most ads are hosted on different servers than the main site itself. If you right-click on the ad, you should - be able to get all the relevant information you need. Alternately, you can + be able to get all the relevant information you need. Alternately, you can find the correct URL by looking at Privoxy's logs (you may need to enable logging in the main config file if its disabled). - Below is a slightly modified real-life log snippet that originates with one + Below is a slightly modified real-life log snippet that originates with one requested URL: www.example.com (name of site was changed for this example, the number of requests is real). You can see in this the complexity of what goes into making up this one page. There @@ -2318,8 +2341,8 @@ content is obviously good or bad, but not all. Many of the more questionable looking requests, are going to outside domains that seem to be identifying themselves with suspicious looking names, making - our job a little easier. &my-app; has crunched (meaning caught - and BLOCKED) quite a few items in this example, but perhaps missed a few as well. + our job a little easier. &my-app; has crunched (meaning caught + and BLOCKED) quite a few items in this example, but perhaps missed a few as well. @@ -2372,7 +2395,7 @@ What can I do? - First verify that it is indeed a Privoxy problem, + First verify that it is indeed a Privoxy problem, by toggling off Privoxy through http://config.privoxy.org/toggle (the toggle feature may need to be enabled in the main @@ -2408,13 +2431,13 @@ on again. Remember to flush your browser's caches in between any such changes! - Alternately, if you are comfortable with a text editor, you can accomplish - the same thing by editing the appropriate actions file. Probably the easiest + Alternately, if you are comfortable with a text editor, you can accomplish + the same thing by editing the appropriate actions file. Probably the easiest way to deal with such problems when editing by hand is to add your site to a { fragile } section in user.action, which is an alias that turns off most dangerous actions, but is also likely to turn off more actions then needed, and thus lower - your privacy and protection more than necessary, + your privacy and protection more than necessary, Troubleshooting actions is discussed in more detail in the - As a last resort, you can always see if your browser has a setting that will + As a last resort, you can always see if your browser has a setting that will bypass the proxy setting for selective sites. Modern browsers can do this. @@ -2472,7 +2495,7 @@ set-up DUN connection and each LAN connection in IE store the settings for each user individually. As such this enforces individual configurations rather than common ones. Hence the first time you use a DUN connection after - re-booting your system it may not perform as you expect, and prompt you for + re-booting your system it may not perform as you expect, and prompt you for the password. Just set and save the password again and all should be OK. @@ -2487,16 +2510,16 @@ I cannot connect to any FTP sites. Privoxy is blocking me. - Privoxy cannot act as a proxy for FTP traffic, + Privoxy cannot act as a proxy for FTP traffic, so do not configure your browser to use Privoxy as an FTP proxy. The same is true for any protocol other than HTTP - or HTTPS (SSL). + or HTTPS (SSL). Most browsers understand FTP as well as HTTP. If you connect to a site, with a URL like ftp://ftp.example.com, your browser is making - an FTP connection, and not a HTTP connection. So while your browser may - speak FTP, Privoxy does not, and cannot proxy + an FTP connection, and not a HTTP connection. So while your browser may + speak FTP, Privoxy does not, and cannot proxy such traffic. @@ -2506,7 +2529,7 @@ accidentally enable FTP proxying in these cases. And of course, if this happens, Privoxy will indeed cause problems since it does not know FTP. Just disable the FTP setting + message if a FTP connection is attempted.]]> Just disable the FTP setting and all will be well again. @@ -2518,14 +2541,14 @@ -In Mac OS X, I can't configure Microsoft Internet Explorer to use +<title>In Mac OS X, I can't configure Microsoft Internet Explorer to use Privoxy as the HTTP proxy. Microsoft Internet Explorer (in versions like 5.1) respects system-wide network settings. In order to change the HTTP proxy, open System Preferences, and click on the Network icon. In the settings pane that - comes up, click on the Proxies tab. Ensure the "Web Proxy (HTTP)" checkbox - is checked and enter 127.0.0.1 in the entry field. + comes up, click on the Proxies tab. Ensure the "Web Proxy (HTTP)" checkbox + is checked and enter 127.0.0.1 in the entry field. Enter 8118 in the Port field. The next time you start IE, it should reflect these values. @@ -2533,12 +2556,12 @@ -In Mac OS X, I dragged the Privoxy folder to the trash in order to +<title>In Mac OS X, I dragged the Privoxy folder to the trash in order to uninstall it. Now the finder tells me I don't have sufficient privileges to empty the trash. Note: This ONLY applies to privoxy 3.0.6 and earlier. - + Just dragging the Privoxy folder to the trash is not enough to delete it. Privoxy supplies an @@ -2546,9 +2569,9 @@ these details. Open the trash, drag the uninstall.command file out of the trash and double-click on it. You will be prompted for confirmation and the administration password. - + - The trash may still appear full after this command; emptying the trash + The trash may still appear full after this command; emptying the trash from the desktop should make it appear empty again. @@ -2561,7 +2584,7 @@ localhost as my browser's proxy setting. We believe this is due to an IPv6-related bug in Mac OS X, but don't fully - understand the issue yet. In any case, changing the proxy setting to + understand the issue yet. In any case, changing the proxy setting to 127.0.0.1 instead of localhost works around the problem. @@ -2586,9 +2609,9 @@ user.action: - # Make exceptions for ill-behaved sites: - # - {-prevent-compression} + # Make exceptions for ill-behaved sites: + # + {-prevent-compression} .example.com If that works, you may also want to report the problem to the @@ -2606,7 +2629,7 @@ its running on from the IP address of the system interface it is bound to (from the config file listen-address setting). If the system cannot supply - this information, Privoxy logs this condition. + this information, Privoxy logs this condition. Typically, this would be considered a minor system configuration error. It is @@ -2627,11 +2650,11 @@ -When I try to launch Privoxy, I get an +<title>When I try to launch Privoxy, I get an error message <quote>port 8118 is already in use</quote> (or similar wording). Why? - Port 8118 is Privoxy's default TCP + Port 8118 is Privoxy's default TCP listening port. Typically this message would mean that there is already one instance of Privoxy running, and your system is actually trying to start a second @@ -2661,8 +2684,8 @@ is used? - This may also be caused by the demoronizer filter, - in conjunction with a web server that is misreporting the content type. Binary + This may also be caused by the demoronizer filter, + in conjunction with a web server that is misreporting the content type. Binary files are exempted from Privoxy's filtering (unless the web server by mistake says the file is something else). Either upgrade Privoxy, or go to the most recent @@ -2676,26 +2699,26 @@ What is the demoronizer and why is it there? - The original demoronizer was a Perl script that cleaned up HTML pages which - were created with certain Microsoft products. MS has used proprietary extensions + The original demoronizer was a Perl script that cleaned up HTML pages which + were created with certain Microsoft products. MS has used proprietary extensions to standardized font encodings (ISO 8859-1), which has caused problems for pages that are viewed with non-Microsoft products (and are expecting to see a standard set of fonts). The demoronizer corrected these errors so the pages displayed correctly. Privoxy borrowed from this script, introducing a filter based on the original demoronizer, which in turn could - correct these errors on the fly. + correct these errors on the fly. - But this is only needed in some situations, and will cause serious problems in some + But this is only needed in some situations, and will cause serious problems in some other situations. - If you are using Microsoft products, you do not need it. If you need to view - pages with UTF-8 characters (such as Cyrillic or Chinese), then it will + If you are using Microsoft products, you do not need it. If you need to view + pages with UTF-8 characters (such as Cyrillic or Chinese), then it will cause corruption of the fonts, and thus should not be on. - On the other hand, if you use non-Microsoft products, and you occasionally + On the other hand, if you use non-Microsoft products, and you occasionally notice weird characters on pages, you might want to try it. @@ -2705,16 +2728,16 @@ Why do I keep seeing PrivoxyWindowOpen() in raw source code? - Privoxy is attempting to disable malicious - Javascript + Privoxy is attempting to disable malicious + Javascript in this case, with the unsolicited-popups - filter. Privoxy cannot tell very well + filter. Privoxy cannot tell very well good code snippets from bad code snippets. - If you see this in HTML source, and the page displays without problems, then - this is good, and likely some pop-up window was disabled. If you see this - where it is causing a problem, such as a downloaded program source code file, + If you see this in HTML source, and the page displays without problems, then + this is good, and likely some pop-up window was disabled. If you see this + where it is causing a problem, such as a downloaded program source code file, then you should set an exception for this site or page such that the integrity of the page stays in tact by disabling all filtering. @@ -2752,13 +2775,13 @@ - At one site Privoxy just hangs, and starts taking + At one site Privoxy just hangs, and starts taking all CPU. Why is this? This is probably a manifestation of the 100% cpu problem that - occurs on pages containing many (thousands upon thousands) of blank lines. The blank lines - are in the raw HTML source of the page, and the browser just ignores them. But the + occurs on pages containing many (thousands upon thousands) of blank lines. The blank lines + are in the raw HTML source of the page, and the browser just ignores them. But the pattern matching in Privoxy's page filtering mechanism is trying to match against absurdly long strings and this becomes very CPU-intensive, taking a long, long time to complete. @@ -2886,7 +2909,7 @@ If you compiled &my-app; with threading support (on POSIX-based systems), the Conditional #defines section on http://config.privoxy.org/show-status - will list FEATURE_PTHREAD as enabled. + will list FEATURE_PTHREAD as enabled. @@ -2899,18 +2922,18 @@ &contacting; - + Privoxy Copyright, License and History ©right; - + Portions of this document are borrowed from the original - Junkbuster (tm) FAQ, and modified as + Junkbuster (tm) FAQ, and modified as appropriate for Privoxy. @@ -2931,8 +2954,8 @@ - - + + diff -Nru privoxy-3.0.17/doc/source/install.sgml privoxy-3.0.19/doc/source/install.sgml --- privoxy-3.0.17/doc/source/install.sgml 2010-11-06 12:55:48.000000000 +0000 +++ privoxy-3.0.19/doc/source/install.sgml 2011-12-26 17:05:40.000000000 +0000 @@ -1,7 +1,7 @@ + - + @@ -15,16 +15,16 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/install.sgml,v $ Purpose : INSTALL file for Privoxy - - $Id: install.sgml,v 2.17 2010/11/06 12:55:48 fabiankeil Exp $ + + $Id: install.sgml,v 2.21 2011/12/26 17:05:40 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. You have been warned! - Failure to abide by this rule will result in the revocation of your license + Failure to abide by this rule will result in the revocation of your license to live a peaceful existence! ======================================================================== @@ -62,10 +62,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -80,8 +80,8 @@ * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * or write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA * *********************************************************************/ diff -Nru privoxy-3.0.17/doc/source/ldp.dsl.in privoxy-3.0.19/doc/source/ldp.dsl.in --- privoxy-3.0.17/doc/source/ldp.dsl.in 2008-01-19 21:48:32.000000000 +0000 +++ privoxy-3.0.19/doc/source/ldp.dsl.in 2011-03-03 14:22:26.000000000 +0000 @@ -83,7 +83,7 @@ ;; REFENTRY body-attr ;; PURP What attributes should be hung off of BODY? ;; DESC - ;; A list of the the BODY attributes that should be generated. + ;; A list of the BODY attributes that should be generated. ;; The format is a list of lists, each interior list contains the ;; name and value of a BODY attribute. ;; /DESC diff -Nru privoxy-3.0.17/doc/source/license.sgml privoxy-3.0.19/doc/source/license.sgml --- privoxy-3.0.17/doc/source/license.sgml 2009-02-15 15:12:06.000000000 +0000 +++ privoxy-3.0.19/doc/source/license.sgml 2011-09-04 11:10:12.000000000 +0000 @@ -2,17 +2,17 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/license.sgml,v $ Purpose : Entity included in other project documents. - - $Id: license.sgml,v 2.6 2008/05/23 15:09:48 fabiankeil Exp $ + + $Id: license.sgml,v 2.7 2011/09/04 11:10:12 fabiankeil Exp $ Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/ See LICENSE. - + ====================================================================== This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -27,7 +27,7 @@ Privoxy is free software; you can - redistribute it and/or modify it under the terms of the + redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. diff -Nru privoxy-3.0.17/doc/source/p-authors.sgml privoxy-3.0.19/doc/source/p-authors.sgml --- privoxy-3.0.17/doc/source/p-authors.sgml 2009-12-16 08:28:11.000000000 +0000 +++ privoxy-3.0.19/doc/source/p-authors.sgml 2011-12-26 18:41:54.000000000 +0000 @@ -2,8 +2,8 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/p-authors.sgml,v $ Purpose : Entity included in other project documents. - - $Id: p-authors.sgml,v 2.41 2009/12/16 08:28:11 fabiankeil Exp $ + + $Id: p-authors.sgml,v 2.44 2011/12/26 18:41:54 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. @@ -12,7 +12,7 @@ This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -35,8 +35,6 @@ ]]> Hal Burgiss - Mark Miller - Gerry Murphy Lee Rian Roland Rosenfeld The Main Configuration File - Again, the main configuration file is named config on - Linux/Unix/BSD and OS/2, and config.txt on Windows. + By default, the main configuration file is named config, + with the exception of Windows, where it is named config.txt. Configuration lines consist of an initial keyword followed by a list of values, all separated by whitespace (any number of spaces or tabs). For example: @@ -59,11 +59,11 @@ - + confdir /etc/privoxy - + @@ -97,10 +97,10 @@ Sample Configuration File for Privoxy v&p-version; - $Id: p-config.sgml,v 2.66 2010/11/08 17:54:21 fabiankeil Exp $ + $Id: p-config.sgml,v 2.79 2011/09/04 11:10:12 fabiankeil Exp $ -Copyright (C) 2001-2010 Privoxy Developers http://www.privoxy.org/ +Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ @@ -167,7 +167,7 @@ Thus, by placing a # at the start of an existing configuration line, - you can make it a comment and it will be treated as if it weren't there. + you can make it a comment and it will be treated as if it weren't there. This is called "commenting out" an option and can be useful. Removing the # again is called "uncommenting". @@ -237,11 +237,11 @@ Notes: - The User Manual URI is the single best source of information on + The User Manual URI is the single best source of information on Privoxy, and is used for help links from some of the internal CGI pages. The manual itself is normally packaged with the binary distributions, so you probably want to set this to a locally - installed copy. + installed copy. Examples: @@ -265,7 +265,7 @@   user-manual  file://///some-server/some-path/privoxy-&p-version;/user-manual/ - --> + --> The best all purpose solution is simply to put the full local PATH to where the User Manual is @@ -281,7 +281,7 @@ (or the shortcut: http://p.p/user-manual/). - If the documentation is not on the local system, it can be accessed + If the documentation is not on the local system, it can be accessed from a remote server, as: @@ -295,7 +295,7 @@ file, because it is used while the config file is being read on start-up. - + ]]>
- + If set, this option should be the first option in the config file, because it is used while the config file is being read. @@ -327,7 +327,7 @@ Specifies: - A URL to be displayed in the error page that users will see if access to an untrusted page is denied. + A URL to be displayed in the error page that users will see if access to an untrusted page is denied. @@ -415,7 +415,7 @@ If both admin-address and proxy-info-url are unset, the whole "Local Privoxy Support" box on all generated pages will not be shown. - + @@ -464,10 +464,10 @@ If both admin-address and proxy-info-url are unset, the whole "Local Privoxy Support" box on all generated pages will not be shown. - + This URL shouldn't be blocked ;-) - + @@ -489,7 +489,7 @@ Privoxy can (and normally does) use a number of other files for additional configuration, help and logging. This section of the configuration file tells Privoxy - where to find those other files. + where to find those other files. @@ -533,16 +533,16 @@ No trailing /, please. - + --> @@ -685,7 +685,7 @@ Effect if unset: - No actions are taken at all. More or less neutral proxying. + No actions are taken at all. More or less neutral proxying. @@ -695,15 +695,15 @@ Multiple actionsfile lines are permitted, and are in fact recommended! - + The default values are default.action, which is the main actions file maintained by the developers, and user.action, where you can make your personal additions. - - Actions files contain all the per site and per URL configuration for + + Actions files contain all the per site and per URL configuration for ad blocking, cookie management, privacy considerations, etc. - There is no point in using Privoxy without at + There is no point in using Privoxy without at least one actions file. @@ -772,7 +772,7 @@ rules that use regular expressions. These rules permit powerful changes on the content of Web pages, and optionally the headers as well, e.g., you could try to disable your favorite JavaScript annoyances, - re-write the actual displayed text, or just have some fun + re-write the actual displayed text, or just have some fun playing buzzword bingo with web pages. @@ -858,7 +858,7 @@ periodically remove it. On Unix systems, you can do this with a cron job (see man cron). For Red Hat based Linux distributions, a logrotate script has been included. - + Any log files must be writable by whatever user Privoxy is being run as (on Unix, default user id is privoxy). @@ -911,14 +911,14 @@ If you specify a trust file, Privoxy will only allow - access to sites that are specified in the trustfile. Sites can be listed + access to sites that are specified in the trustfile. Sites can be listed in one of two ways: - Prepending a ~ character limits access to this site - only (and any sub-paths within this site), e.g. + Prepending a ~ character limits access to this site + only (and any sub-paths within this site), e.g. ~www.example.com allows access to - ~www.example.com/features/news.html, etc. + ~www.example.com/features/news.html, etc. Or, you can designate sites as trusted referrers, by @@ -932,7 +932,7 @@ made. - If you use the + operator in the trust file, it may grow + If you use the + operator in the trust file, it may grow considerably over time. @@ -944,7 +944,7 @@ Possible applications include limiting Internet access for children. - + @@ -1194,7 +1194,7 @@ Specifies: - The IP address and TCP port on which Privoxy will + The address and TCP port on which Privoxy will listen for client requests. @@ -1203,6 +1203,7 @@ Type of value: [IP-Address]:Port + [Hostname]:Port @@ -1234,14 +1235,55 @@ will need to override the default. + You can use this statement multiple times to make + Privoxy listen on more ports or more + IP addresses. Suitable if your operating system does not + support sharing IPv6 and IPv4 protocols + on the same socket. + + + If a hostname is used instead of an IP address, Privoxy + will try to resolve it to an IP address and if there are multiple, use the first + one returned. + + + If the address for the hostname isn't already known on the system + (for example because it's in /etc/hostname), this may result in DNS + traffic. + + + If the specified address isn't available on the system, or if the + hostname can't be resolved, Privoxy + will fail to start. + + IPv6 addresses containing colons have to be quoted by brackets. + They can only be used if Privoxy has + been compiled with IPv6 support. If you aren't sure if your version + supports it, have a look at + http://config.privoxy.org/show-status. + + + Some operating systems will prefer IPv6 to IPv4 addresses even if the + system has no IPv6 connectivity which is usually not expected by the user. + Some even rely on DNS to resolve localhost which mean the "localhost" address + used may not actually be local. + + + It is therefore recommended to explicitly configure the intended IP address + instead of relying on the operating system, unless there's a strong reason not to. - If you leave out the IP address, Privoxy will - bind to all IPv4 interfaces (addresses) on your machine and may become reachable - from the Internet. In that case, consider using access control lists (ACL's, see below), and/or - a firewall. + If you leave out the address, Privoxy will bind to all + IPv4 interfaces (addresses) on your machine and may become reachable from the + Internet and/or the local network. Be aware that some GNU/Linux distributions + modify that behaviour without updating the documentation. Check for non-standard + patches if your Privoxyversion behaves differently. + + + If you configure Privoxyto be reachable from the + network, consider using access control lists + (ACL's, see below), and/or a firewall. If you open Privoxy to untrusted users, you will @@ -1249,6 +1291,12 @@ linkend="enable-edit-actions">enable-edit-actions and enable-remote-toggle + + With the exception noted above, listening on multiple addresses is currently + not supported by Privoxy directly. + It can be done on most operating systems by letting a packet filter + redirect request for certain addresses to Privoxy, though. + @@ -1401,7 +1449,7 @@ Note that you must have compiled Privoxy with - support for this feature, otherwise this option has no effect. + support for this feature, otherwise this option has no effect. @@ -1524,7 +1572,7 @@ Note that you must have compiled Privoxy with - support for this feature, otherwise this option has no effect. + support for this feature, otherwise this option has no effect. @@ -1631,7 +1679,7 @@ [dst_addr[:port][/dst_masklen]] - Where src_addr and + Where src_addr and dst_addr are IPv4 addresses in dotted decimal notation or valid DNS names, port is a port number, and src_masklen and @@ -1678,11 +1726,11 @@ Access controls are included at the request of ISPs and systems administrators, and are not usually needed by individual users. - For a typical home user, it will normally suffice to ensure that + For a typical home user, it will normally suffice to ensure that Privoxy only listens on the localhost (127.0.0.1) or internal (home) network address by means of the listen-address - option. + option. Please see the warnings in the FAQ that Privoxy @@ -1819,7 +1867,7 @@ For content filtering, i.e. the +filter and - +deanimate-gif actions, it is necessary that + +deanimate-gif actions, it is necessary that Privoxy buffers the entire document body. This can be potentially dangerous, since a server could just keep sending data indefinitely and wait for your RAM to exhaust -- with nasty consequences. @@ -1892,7 +1940,7 @@ http_parent[:port] - where target_pattern is a URL pattern + where target_pattern is a URL pattern that specifies to which requests (i.e. URLs) this forward rule shall apply. Use / to denote all URLs. http_parent[:port] @@ -1965,7 +2013,7 @@ - foward / [2001:DB8::1]:8000 + forward / [2001:DB8::1]:8000 @@ -2015,7 +2063,7 @@ and socks_proxy are IP addresses in dotted decimal notation or valid DNS names (http_parent - may be . to denote no HTTP forwarding), and the optional + may be . to denote no HTTP forwarding), and the optional port parameters are TCP ports, i.e. integer values from 1 to 65535 @@ -2090,9 +2138,9 @@ forward-socks4 / socks-gw.example.com:1080 . - + - To chain Privoxy and Tor, both running on the same system, you would use + To chain Privoxy and Tor, both running on the same system, you would use something like: @@ -2141,7 +2189,7 @@ Advanced Forwarding Examples - If you have links to multiple ISPs that provide various special content + If you have links to multiple ISPs that provide various special content only to their subscribers, you can configure multiple Privoxies which have connections to the respective ISPs to act as forwarders to each other, so that your users can see the internal content of all ISPs. @@ -2182,9 +2230,9 @@ - If you intend to chain Privoxy and - squid locally, then chaining as - browser -> squid -> privoxy is the recommended way. + If you intend to chain Privoxy and + squid locally, then chaining as + browser -> squid -> privoxy is the recommended way. @@ -2194,14 +2242,14 @@ - # Define Privoxy as parent proxy (without ICP) - cache_peer 127.0.0.1 parent 8118 7 no-query + # Define Privoxy as parent proxy (without ICP) + cache_peer 127.0.0.1 parent 8118 7 no-query - # Define ACL for protocol FTP - acl ftp proto FTP + # Define ACL for protocol FTP + acl ftp proto FTP # Do not forward FTP requests to Privoxy - always_direct allow ftp + always_direct allow ftp # Forward all the rest to Privoxy never_direct allow all @@ -2221,7 +2269,7 @@ forward / . - forward /.*\.(exe|com|dll|zip)$ antivir.example.com:8010 + forward /.*\.(exe|com|dll|zip)$ antivir.example.com:8010 @@ -2233,7 +2281,7 @@ Specifies: - How often Privoxy retries if a forwarded connection request fails. + How often Privoxy retries if a forwarded connection request fails. @@ -2278,10 +2326,6 @@ that go away when you try again manually. Start with a small value and check Privoxy's logfile from time to time, to see how many retries are usually needed. - - Due to a bug, this option currently also causes Privoxy to - retry in case of certain problems with direct connections. - @@ -2340,7 +2384,7 @@ If you don't trust your clients and want to force them to use Privoxy, enable this option and configure your packet filter to redirect outgoing - HTTP connections into Privoxy. + HTTP connections into Privoxy. Make sure that Privoxy's own requests @@ -2790,9 +2834,9 @@ Notes: - For SOCKS requests the timeout currently doesn't start until - the SOCKS server accepted the request. This will be fixed in - the next release. + The default is quite high and you probably want to reduce it. + If you aren't using an occasionally slow proxy like Tor, reducing + it to a few seconds should be fine. @@ -2893,7 +2937,48 @@ handle-as-empty-doc-returns-ok - Note: + Specifies: + + + The status code Privoxy returns for pages blocked with + + +handle-as-empty-document. + + + + + Type of value: + + + 0 or 1 + + + + + Default value: + + 0 + + + + Effect if unset: + + + Privoxy returns a status 403(forbidden) for all blocked pages. + + + + + Effect if set: + + + Privoxy returns a status 200(OK) for pages blocked with +handle-as-empty-document + and a status 403(Forbidden) for all other blocked pages. + + + + + Notes: This is a work-around for Firefox bug 492459: @@ -2902,16 +2987,24 @@ (https://bugzilla.mozilla.org/show_bug.cgi?id=492459) + As the bug has been fixed for quite some time this option should no longer + be needed and will be removed in a future release. Please speak up if you + have a reason why the option should be kept around. + +@@#handle-as-empty-doc-returns-ok 1]]> + + + +enable-compression + Specifies: - The status code Privoxy returns for pages blocked with - - +handle-as-empty-document. + Whether or not buffered content is compressed before delivery. @@ -2933,7 +3026,7 @@ Effect if unset: - Privoxy returns a status 403(forbidden) for all blocked pages. + Privoxy does not compress buffered content. @@ -2941,13 +3034,95 @@ Effect if set: - Privoxy returns a status 200(OK) for pages blocked with +handle-as-empty-document - and a status 403(Forbidden) for all other blocked pages. + Privoxy compresses buffered content before delivering it to the client, + provided the client supports it. + + + + + Notes: + + + This directive is only supported if Privoxy has been compiled with + FEATURE_COMPRESSION, which should not to be confused with FEATURE_ZLIB. + + + Compressing buffered content is mainly useful if Privoxy and the + client are running on different systems. If they are running on the + same system, enabling compression is likely to slow things down. + If you didn't measure otherwise, you should assume that it does + and keep this option disabled. + + + Privoxy will not compress buffered content below a certain length. + + + + +@@#enable-compression 1]]> + + + +compression-level + + + Specifies: + + + The compression level that is passed to the zlib library when compressing buffered content. + + + + + Type of value: + + + Positive number ranging from 0 to 9. + + + + + Default value: + + 1 + + + + Notes: + + + Compressing the data more takes usually longer than compressing + it less or not compressing it at all. Which level is best depends + on the connection between Privoxy and the client. If you can't + be bothered to benchmark it for yourself, you should stick with + the default and keep compression disabled. + + + If compression is disabled, the compression level is irrelevant. + + + + + Examples: + + + + # Best speed (compared to the other levels) + compression-level 1 + # Best compression + compression-level 9 + # No compression. Only useful for testing as the added header + # slightly increases the amount of data that has to be sent. + # If your benchmark shows that using this compression level + # is superior to using no compression at all, the benchmark + # is likely to be flawed. + compression-level 0 + -@@handle-as-empty-doc-returns-ok 1]]> +@@#compression-level 1]]> @@ -2977,11 +3152,11 @@ - + activity-animation 1 - + ]]> @@ -2998,18 +3173,18 @@ - + log-messages 1 - + ]]> @@]]> - + If log-buffer-size is set to 1, the size of the log buffer, i.e. the amount of memory used for the log messages displayed in the console window, will be limited to log-max-lines (see below). @@ -3024,11 +3199,11 @@ - + log-buffer-size 1 - + ]]> @@ -3044,11 +3219,11 @@ - + log-max-lines 200 - + ]]> @@ -3065,11 +3240,11 @@ - + log-highlight-messages 1 - + ]]> @@ -3084,11 +3259,11 @@ - + log-font-name Comic Sans MS - + ]]> @@ -3103,18 +3278,18 @@ - + log-font-size 8 - + ]]> @@]]> - + show-on-task-bar controls whether or not Privoxy will appear as a button on the Task bar when minimized: @@ -3124,11 +3299,11 @@ - + show-on-task-bar 0 - + ]]> @@ -3145,11 +3320,11 @@ - + close-button-minimizes 1 - + ]]> @@ -3167,11 +3342,11 @@ - + #hide-console - + ]]> diff -Nru privoxy-3.0.17/doc/source/privoxy-man-page.sgml privoxy-3.0.19/doc/source/privoxy-man-page.sgml --- privoxy-3.0.17/doc/source/privoxy-man-page.sgml 2010-11-06 12:55:48.000000000 +0000 +++ privoxy-3.0.19/doc/source/privoxy-man-page.sgml 2011-12-26 17:05:40.000000000 +0000 @@ -4,22 +4,22 @@ Purpose : Manual Page This file belongs into ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/ - - $Id: privoxy-man-page.sgml,v 2.36 2010/11/06 12:55:48 fabiankeil Exp $ + + $Id: privoxy-man-page.sgml,v 2.40 2011/12/26 17:05:40 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching - anything in this, or other Privoxy documentation. + NOTE: Please read developer-manual/documentation.html before touching + anything in this, or other Privoxy documentation. ======================================================================== Doc NOTES: This is some tricky markup! There are some quirks to how this markup is handled. It is not always so co-operative. - Please don't change the markup unless you can verify the changes - will improve finished output! - + Please don't change the markup unless you can verify the changes + will improve finished output! + literallayout tags are particularly sensitive to where they are placed. The 'replaceable' and 'command' tags are used here somewhat unconventionally, since it seems to generate the proper formatting (at least for me :). @@ -28,21 +28,21 @@ Requires docbook2man (short perl script), see CVS http://sources.redhat.com/docbook-tools/. Also requires openjade and SGMLSpm - perl module. - + perl module. + For man page references, see: http://www.linuxdoc.org/HOWTO/mini/DocBook-Install/using.html http://docbook.org/tdg/en/html/ch02.html#making-refentry --> + - + @@ -57,7 +57,7 @@ 2009-02-15 - privoxy + privoxy 1 Privoxy &p-version; @@ -70,16 +70,16 @@ - + privoxy - pidfile - user[.group] + pidfile + user[.group] - hostname - configfile + hostname + configfile @@ -92,7 +92,7 @@ options: - + --help @@ -157,7 +157,7 @@ Privoxy process that the directory tree starts there. If set up carefully, this can limit the impact of possible vulnerabilities in Privoxy to the files contained in - that hierarchy. + that hierarchy. @@ -177,7 +177,7 @@ If the configfile is not specified on the command line, Privoxy will look for a file named config in the current directory. If no - configfile is found, Privoxy will + configfile is found, Privoxy will fail to start. @@ -201,21 +201,21 @@ filter to build an intercepting proxy (see config). The default setting is for localhost, on port 8118 (configurable in the main config file). To set the - HTTP proxy in Firefox, go through: Tools; + HTTP proxy in Firefox, go through: Tools; Options; General; Connection Settings; - Manual Proxy Configuration. + Manual Proxy Configuration. - For Internet Explorer, go through: Tools; + For Internet Explorer, go through: Tools; Internet Properties; Connections; - LAN Settings. + LAN Settings. The Secure (SSL) Proxy should also be set to the same values, otherwise https: URLs will not be proxied. Note: Privoxy can only proxy HTTP and HTTPS traffic. Do not try it with FTP or other protocols. - HTTPS presents some limitations, and not all features will work with HTTPS + HTTPS presents some limitations, and not all features will work with HTTPS connections. @@ -231,25 +231,25 @@ Privoxy can be configured with the various configuration files. The default configuration files are: config, default.filter, default.action and - default.action. user.action should + default.action. user.action should be used for locally defined exceptions to the default rules in match-all.action and default.action, and user.filter for locally defined filters. These are well commented. On Unix and Unix-like systems, these are located in - /etc/privoxy/ by default. + /etc/privoxy/ by default. - - Privoxy uses the concept of actions + + Privoxy uses the concept of actions in order to manipulate the data stream between the browser and remote sites. - There are various actions available with specific functions for such things + There are various actions available with specific functions for such things as blocking web sites, managing cookies, etc. These actions can be invoked - individually or combined, and used against individual URLs, or groups of URLs + individually or combined, and used against individual URLs, or groups of URLs that can be defined using wildcards and regular expressions. The result is that the user has greatly enhanced control and freedom. The actions list (ad blocks, etc) can also be configured with your - web browser at http://config.privoxy.org/ + web browser at http://config.privoxy.org/ (assuming the configuration allows it). Privoxy's configuration parameters can also be viewed at the same page. In addition, Privoxy can be toggled on/off. @@ -268,7 +268,7 @@ Files - + /usr/sbin/privoxy /etc/privoxy/config /etc/privoxy/match-all.action @@ -296,11 +296,11 @@ Privoxy terminates on the SIGINT, SIGTERM and SIGABRT signals. Log - rotation scripts may cause a re-opening of the logfile by sending a + rotation scripts may cause a re-opening of the logfile by sending a SIGHUP to Privoxy. Note that unlike other daemons, Privoxy does not need to be made aware of config file changes by SIGHUP -- it will detect them - automatically. + automatically. diff -Nru privoxy-3.0.17/doc/source/privoxy.sgml privoxy-3.0.19/doc/source/privoxy.sgml --- privoxy-3.0.17/doc/source/privoxy.sgml 2010-02-19 16:44:42.000000000 +0000 +++ privoxy-3.0.19/doc/source/privoxy.sgml 2011-09-04 11:10:12.000000000 +0000 @@ -2,17 +2,17 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/privoxy.sgml,v $ Purpose : Entity included in other project documents. - - $Id: privoxy.sgml,v 2.10 2010/02/19 16:44:42 fabiankeil Exp $ - Copyright (C) 2001-2010 Privoxy Developers http://www.privoxy.org/ + $Id: privoxy.sgml,v 2.12 2011/09/04 11:10:12 fabiankeil Exp $ + + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ====================================================================== This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: diff -Nru privoxy-3.0.17/doc/source/readme.sgml privoxy-3.0.19/doc/source/readme.sgml --- privoxy-3.0.17/doc/source/readme.sgml 2010-11-13 13:23:12.000000000 +0000 +++ privoxy-3.0.19/doc/source/readme.sgml 2011-12-26 17:05:40.000000000 +0000 @@ -1,10 +1,10 @@ + - + @@ -16,23 +16,23 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/readme.sgml,v $ Purpose : README for Privoxy - - $Id: readme.sgml,v 2.43 2010/11/13 13:23:12 fabiankeil Exp $ - Copyright (C) 2001-2010 Privoxy Developers http://www.privoxy.org/ + $Id: readme.sgml,v 2.49 2011/12/26 17:05:40 fabiankeil Exp $ + + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. You have been warned! - Failure to abide by this rule will result in the revocation of your license + Failure to abide by this rule will result in the revocation of your license to live a peaceful existence! ======================================================================== =================================================================== - READ: Document Note: This file generates the README in the top level - source directory. It is generated as only a plain text file. The - current markup is not suitable for other formats. Build from + READ: Document Note: This file generates the README in the top level + source directory. It is generated as only a plain text file. The + current markup is not suitable for other formats. Build from Makefile with 'make dok-readme'. =================================================================== @@ -40,21 +40,21 @@ ====================================================================== NOTE: The left margin spacing is *important* when using 'literallayout' - WYSISWYG!!! Don't mess this up!!! Careful with linebreaks too, ie + WYSISWYG!!! Don't mess this up!!! Careful with linebreaks too, ie the para tag forces a linebreak. Tags need to be carefully placed as a result - to avoid extra blank lines, etc. + to avoid extra blank lines, etc. ====================================================================== - For stable releases, change - - entity % p-not-stable "INCLUDE" - - to - - entity % p-not-stable "IGNORE" - + For stable releases, change + + entity % p-not-stable "INCLUDE" + + to + + entity % p-not-stable "IGNORE" + in the DTD at the top. This will toggle various text 'off'. BOTH - MUST be toggled in this case or you will get both text referencing + MUST be toggled in this case or you will get both text referencing stable and unstable versions. You only want one or the other! --> @@ -80,14 +80,14 @@ * * Purpose : README file to give a short intro. * - * Copyright : Written by and Copyright (C) 2001-2010 the + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -102,8 +102,8 @@ * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/copyleft/gpl.html - * or write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * or write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA * *********************************************************************/ @@ -126,22 +126,10 @@ -IMPORTANT CHANGES - - November 2010, Privoxy 3.0.17 stable is released. - - - This is mainly a bug-fix release for the previously released - Privoxy 3.0.16. - +CHANGES - It contains fixes for two bugs that could cause connections to hang - under certain circumstances when keep-alive support was enabled, - until they timed out or where closed by the server. - - - As usual, there are also a bunch of minor improvements. - For details please see the "ChangeLog", the "What's New" section or + For a list of changes in this release, please have a + look at the "ChangeLog", the "What's New" section or the "Upgrader's Notes" in the User Manual. @@ -149,10 +137,10 @@ INSTALL - + See the INSTALL file in this directory, for installing from raw source, and the User Manual, for all other - installation types. + installation types. @@ -164,7 +152,7 @@ HOSTNAME ][config_file] - See the man page or User Manual for an explanation of each option, and + See the man page or User Manual for an explanation of each option, and other configuration and usage issues. @@ -209,10 +197,10 @@ DOCUMENTATION There should be documentation in the 'doc' subdirectory. In particular, see the + may not be completed at this point]]>. In particular, see the User Manual there, the FAQ, and those interested in Privoxy development, should look at - developer-manual. + developer-manual. The source and configuration files are all well commented. The main configuration files are: 'config', 'default.action', and - 'default.filter'. + 'default.filter'. - Included documentation may vary according to platform and packager. All - documentation is posted on http://www.privoxy.org, in case you don't have it, + Included documentation may vary according to platform and packager. All + documentation is posted on http://www.privoxy.org, in case you don't have it, or can't find it. @@ -244,7 +232,7 @@ - + diff -Nru privoxy-3.0.17/doc/source/seealso.sgml privoxy-3.0.19/doc/source/seealso.sgml --- privoxy-3.0.17/doc/source/seealso.sgml 2009-02-23 10:42:58.000000000 +0000 +++ privoxy-3.0.19/doc/source/seealso.sgml 2011-09-04 11:10:12.000000000 +0000 @@ -2,8 +2,8 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/seealso.sgml,v $ Purpose : Entity included in other project documents. - - $Id: seealso.sgml,v 2.12 2009/02/23 10:42:58 fabiankeil Exp $ + + $Id: seealso.sgml,v 2.13 2011/09/04 11:10:12 fabiankeil Exp $ Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/ See LICENSE. @@ -12,7 +12,7 @@ This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -22,7 +22,7 @@ faq developer-manual - NOTE: 04/05/02, HB Removed   tags. They were causing docbook2man + NOTE: 04/05/02, HB Removed   tags. They were causing docbook2man to barf. --> @@ -36,28 +36,28 @@ http://www.privoxy.org/, - the Privoxy Home page. + url="http://www.privoxy.org/">http://www.privoxy.org/, + the Privoxy Home page. http://www.privoxy.org/faq/, - the Privoxy FAQ. + url="http://www.privoxy.org/faq/">http://www.privoxy.org/faq/, + the Privoxy FAQ. http://www.privoxy.org/developer-manual/, - the Privoxy developer manual. + url="http://www.privoxy.org/developer-manual/">http://www.privoxy.org/developer-manual/, + the Privoxy developer manual. - https://sourceforge.net/projects/ijbswa/, - the Project Page for Privoxy on + https://sourceforge.net/projects/ijbswa/, + the Project Page for Privoxy on SourceForge. @@ -71,7 +71,7 @@ https://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit misses and other - configuration related suggestions to the developers. + configuration related suggestions to the developers. - https://www.torproject.org/, - Tor can help anonymize web browsing, + https://www.torproject.org/, + Tor can help anonymize web browsing, web publishing, instant messaging, IRC, SSH, and other applications. diff -Nru privoxy-3.0.17/doc/source/supported.sgml privoxy-3.0.19/doc/source/supported.sgml --- privoxy-3.0.17/doc/source/supported.sgml 2009-02-15 15:12:06.000000000 +0000 +++ privoxy-3.0.19/doc/source/supported.sgml 2011-09-04 11:10:12.000000000 +0000 @@ -2,8 +2,8 @@ File : $Source: /cvsroot/ijbswa/current/doc/source/supported.sgml,v $ Purpose : Entity included in other project documents. - - $Id: supported.sgml,v 2.9 2008/01/17 01:49:51 hal9 Exp $ + + $Id: supported.sgml,v 2.10 2011/09/04 11:10:12 fabiankeil Exp $ Copyright (C) 2001-2008 Privoxy Developers http://www.privoxy.org/ See LICENSE. @@ -12,7 +12,7 @@ This file used for inclusion with other documents only. ====================================================================== - If you make changes to this file, please verify the finished + If you make changes to this file, please verify the finished docs all display as intended. This file is included into: @@ -34,13 +34,13 @@ But any operating system that runs TCP/IP, can conceivably take advantage of Privoxy in a networked situation where - Privoxy would run as a server on a LAN gateway. + Privoxy would run as a server on a LAN gateway. Then only the gateway needs to be running one of the above operating systems. - Source code is freely available, so porting to other operating systems + Source code is freely available, so porting to other operating systems is always a possibility. ]]> diff -Nru privoxy-3.0.17/doc/source/user-manual.sgml privoxy-3.0.19/doc/source/user-manual.sgml --- privoxy-3.0.17/doc/source/user-manual.sgml 2010-11-13 20:17:11.000000000 +0000 +++ privoxy-3.0.19/doc/source/user-manual.sgml 2011-12-26 17:05:40.000000000 +0000 @@ -1,5 +1,5 @@ + @@ -11,7 +11,7 @@ - + @@ -34,13 +34,13 @@ This file belongs into ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/ - $Id: user-manual.sgml,v 2.129 2010/11/13 20:17:11 fabiankeil Exp $ + $Id: user-manual.sgml,v 2.146 2011/12/26 17:05:40 fabiankeil Exp $ - Copyright (C) 2001-2010 Privoxy Developers http://www.privoxy.org/ + Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/ See LICENSE. ======================================================================== - NOTE: Please read developer-manual/documentation.html before touching + NOTE: Please read developer-manual/documentation.html before touching anything in this, or other Privoxy documentation. ======================================================================== @@ -55,12 +55,12 @@ - Copyright &my-copy; 2001-2010 by + Copyright &my-copy; 2001-2011 by Privoxy Developers -$Id: user-manual.sgml,v 2.129 2010/11/13 20:17:11 fabiankeil Exp $ +$Id: user-manual.sgml,v 2.146 2011/12/26 17:05:40 fabiankeil Exp $ Features - In addition to the core - features of ad blocking and + In addition to the core + features of ad blocking and cookie management, Privoxy provides many supplemental - features, + features, that give the end-user more control, more privacy and more freedom: @@ -165,14 +165,14 @@ - Note: - On some platforms, the installer may remove previously installed versions, if + Note: + On some platforms, the installer may remove previously installed versions, if found. (See below for your platform). In any case be sure to backup your old configuration if it is valuable to you. See the note to upgraders section below. - + Binary Packages How to install the binary packages depends on your operating system: @@ -185,7 +185,7 @@ RPMs can be installed with rpm -Uvh privoxy-&p-version;-1.rpm, - and will use /etc/privoxy for the location + and will use /etc/privoxy for the location of configuration files. @@ -193,13 +193,13 @@ Note that on Red Hat, Privoxy will not be automatically started on system boot. You will need to enable that using chkconfig, - ntsysv, or similar methods. + ntsysv, or similar methods. - If you have problems with failed dependencies, try rebuilding the SRC RPM: - rpm --rebuild privoxy-&p-version;-1.src.rpm. This - will use your locally installed libraries and RPM version. + If you have problems with failed dependencies, try rebuilding the SRC RPM: + rpm --rebuild privoxy-&p-version;-1.src.rpm. This + will use your locally installed libraries and RPM version. @@ -214,7 +214,7 @@ Debian and Ubuntu DEBs can be installed with apt-get install privoxy, - and will use /etc/privoxy for the location of + and will use /etc/privoxy for the location of configuration files. @@ -225,7 +225,7 @@ Just double-click the installer, which will guide you through the installation process. You will find the configuration files - in the same directory as you installed Privoxy in. + in the same directory as you installed Privoxy in. Version 3.0.5 beta introduced full Windows service @@ -256,7 +256,7 @@ command: services.msc. If you do not take the manual step of modifying Privoxy's service settings, it will not start. Note too that you will need to give Privoxy a user account that - actually exists, or it will not be permitted to + actually exists, or it will not be permitted to write to its log and configuration files. @@ -277,7 +277,7 @@ First, make sure that no previous installations of - Junkbuster and / or + Junkbuster and / or Privoxy are left on your system. Check that no Junkbuster or Privoxy objects are in @@ -311,7 +311,7 @@ installation (in addition to every time your computer starts up). To prevent the privoxy service from automatically starting when your computer starts up, remove or rename the folder named - /Library/StartupItems/Privoxy. + /Library/StartupItems/Privoxy. To manually start or stop the privoxy service, use the Privoxy Utility @@ -323,9 +323,9 @@ AmigaOS - Copy and then unpack the lha archive to a suitable location. + Copy and then unpack the lha archive to a suitable location. All necessary files will be installed into Privoxy - directory, including all configuration and log files. To uninstall, just + directory, including all configuration and log files. To uninstall, just remove this directory. @@ -352,19 +352,19 @@ Gentoo - Gentoo source packages (Ebuilds) for Privoxy are - contained in the Gentoo Portage Tree (they are not on the download page, - but there is a Gentoo section, where you can see when a new + Gentoo source packages (Ebuilds) for Privoxy are + contained in the Gentoo Portage Tree (they are not on the download page, + but there is a Gentoo section, where you can see when a new Privoxy Version is added to the Portage Tree). - Before installing Privoxy under Gentoo just do - first emerge --sync to get the latest changes from the - Portage tree. With emerge privoxy you install the latest + Before installing Privoxy under Gentoo just do + first emerge --sync to get the latest changes from the + Portage tree. With emerge privoxy you install the latest version. - Configuration files are in /etc/privoxy, the + Configuration files are in /etc/privoxy, the documentation is in /usr/share/doc/privoxy-&p-version; and the Log directory is in /var/log/privoxy. @@ -377,7 +377,7 @@ The most convenient way to obtain the Privoxy sources - is to download the source tarball from our + is to download the source tarball from our project download page. @@ -386,8 +386,8 @@ If you like to live on the bleeding edge and are not afraid of using possibly unstable development versions, you can check out the up-to-the-minute version directly from the - CVS repository. - - + Keeping your Installation Up-to-Date As user feedback comes in and development continues, we will make updated versions @@ -420,7 +420,7 @@ In order not to lose your personal changes and adjustments when updating to the latest default.action file we strongly - recommend that you use user.action and + recommend that you use user.action and user.filter for your local customizations of Privoxy. See the Chapter on actions files for details. @@ -437,509 +437,1031 @@ What's New in this Release - Privoxy 3.0.17 is a stable release. - The changes since 3.0.16 stable are: + Privoxy 3.0.19 is a stable release. + The changes since 3.0.18 stable are: - Fixed last-chunk-detection for responses where the content was small - enough to be read with the body, causing Privoxy to wait for the - end of the content until the server closed the connection or the - request timed out. Reported by "Karsten" in #3028326. - - - - - Responses with status code 204 weren't properly detected as body-less - like RFC2616 mandates. Like the previous bug, this caused Privoxy to - wait for the end of the content until the server closed the connection - or the request timed out. Fixes #3022042 and #3025553, reported by a - user with no visible name. Most likely also fixes a bunch of other - AJAX-related problem reports that got closed in the past due to - insufficient information and lack of feedback. - - - - - Fixed an ACL bug that made it impossible to build a blacklist. - Usually the ACL directives are used in a whitelist, which worked - as expected, but blacklisting is still useful for public proxies - where one only needs to deny known abusers access. - - - - - Added LOG_LEVEL_RECEIVED to log the not-yet-parsed data read from the - network. This should make debugging various parsing issues a lot easier. - - - - - The IPv6 code is enabled by default on Windows versions that support it. - Patch submitted by oCameLo in #2942729. - - - - - In mingw32 versions, the user.filter file is reachable through the - GUI, just like default.filter is. Feature request 3040263. - - - - - Added the configure option --enable-large-file-support to set a few - defines that are required by platforms like GNU/Linux to support files - larger then 2GB. Mainly interesting for users without proper logfile - management. + Bug fixes: + + + + Prevent a segmentation fault when de-chunking buffered content. + It could be triggered by malicious web servers if Privoxy was + configured to filter the content and running on a platform + where SIZE_T_MAX isn't larger than UINT_MAX, which probably + includes most 32-bit systems. On those platforms, all Privoxy + versions before 3.0.19 appear to be affected. + To be on the safe side, this bug should be presumed to allow + code execution as proving that it doesn't seems unrealistic. + + + + + Do not expect a response from the SOCKS4/4A server until it + got something to respond to. This regression was introduced + in 3.0.18 and prevented the SOCKS4/4A negotiation from working. + Reported by qqqqqw in #3459781. + + + - Logging with "debug 16" no longer stops at the first nul byte which is - pretty useless. Non-printable characters are replaced with their hex value - so the result can't span multiple lines making parsing them harder then - necessary. + General improvements: + + + + Fix an off-by-one in an error message about connect failures. + + + + + Use a GNUMakefile variable for the webserver root directory and + update the path. Sourceforge changed it which broke various + web-related targets. + + + + + Update the CODE_STATUS description. + + + + + + + + The following changes were made between 3.0.17 and 3.0.18: + + + + - Privoxy logs when reading an action, filter or trust file. + Bug fixes: + + + + If a generated redirect URL contains characters RFC 3986 doesn't + permit, they are (re)encoded. Not doing this makes Privoxy versions + from 3.0.5 to 3.0.17 susceptible to HTTP response splitting (CWE-113) + attacks if the +fast-redirects{check-decoded-url} action is used. + + + + + Fix a logic bug that could cause Privoxy to reuse a server + socket after it got tainted by a server-header-tagger-induced + block that was triggered before the whole server response had + been read. If keep-alive was enabled and the request following + the blocked one was to the same host and using the same forwarding + settings, Privoxy would send it on the tainted server socket. + While the server would simply treat it as a pipelined request, + Privoxy would later on fail to properly parse the server's + response as it would try to parse the unread data from the + first response as server headers for the second one. + Regression introduced in 3.0.17. + + + + + When implying keep-alive in client_connection(), remember that + the client didn't. Fixes a regression introduced in 3.0.13 that + would cause Privoxy to wait for additional client requests after + receiving a HTTP/1.1 request with "Connection: close" set + and connection sharing enabled. + With clients which terminates the client connection after detecting + that the whole body has been received it doesn't really matter, + but with clients that don't the connection would be kept open until + it timed out. + + + + + Fix a subtle race condition between prepare_csp_for_next_request() + and sweep(). A thread preparing itself for the next client request + could briefly appear to be inactive. + If all other threads were already using more recent files, + the thread could get its files swept away under its feet. + So far this has only been reproduced while stress testing in + valgrind while touching action files in a loop. It's unlikely + to have caused any actual problems in the real world. + + + + + Disable filters if SDCH compression is used unless filtering is forced. + If SDCH was combined with a supported compression algorithm, Privoxy + previously could try to decompress it and ditch the Content-Encoding + header even though the SDCH compression wasn't dealt with. + Reported by zebul666 in #3225863. + + + + + Make a copy of the --user value and only mess with that when splitting + user and group. On some operating systems modifying the value directly + is reflected in the output of ps and friends and can be misleading. + Reported by zepard in #3292710. + + + + + If forwarded-connect-retries is set, only retry if Privoxy is actually + forwarding the request. Previously direct connections would be retried + as well. + + + + + Fixed a small memory leak when retrying connections with IPv6 + support enabled. + + + + + Remove an incorrect assertion in compile_dynamic_pcrs_job_list() + It could be triggered by a pcrs job with an invalid pcre + pattern (for example one that contains a lone quantifier). + + + + + If the --user argument user[.group] contains a dot, always bail out + if no group has been specified. Previously the intended, but undocumented + (and apparently untested), behaviour was to try interpreting the whole + argument as user name, but the detection was flawed and checked for '0' + instead of '\0', thus merely preventing group names beginning with a zero. + + + + + In html_code_map[], use a numeric character reference instead of ' + which wasn't standardized before XHTML 1.0. + + + + + Fix an invalid free when compiled with FEATURE_GRACEFUL_TERMINATION + and shut down through http://config.privoxy.org/die + + + + + In get_actions(), fix the "temporary" backwards compatibility hack + to accept block actions without reason. + It also covered other actions that should be rejected as invalid. + Reported by Billy Crook. + + + - Fixed incorrect regression test markup which caused a test in - 3.0.16 to fail while Privoxy itself was working correctly. - While Privoxy accepts hide-referer, too, the action name is actually - hide-referrer which is also the name used one the final results page, - where the test expected the alias. + General improvements: + + + + Privoxy can (re)compress buffered content before delivering + it to the client. Disabled by default as most users wouldn't + benefit from it. + + + + + The +fast-redirects{check-decoded-url} action checks URL + segments separately. If there are other parameters behind + the redirect URL, this makes it unnecessary to cut them off + by additionally using a +redirect{} pcrs command. + Initial patch submitted by Jamie Zawinski in #3429848. + + + + + When loading action sections, verify that the referenced filters + exist. Currently missing filters only result in an error message, + but eventually the severity will be upgraded to fatal. + + + + + Allow to bind to multiple separate addresses. + Patch set submitted by Petr Pisar in #3354485. + + + + + Set socket_error to errno if connecting fails in rfc2553_connect_to(). + Previously rejected direct connections could be incorrectly reported + as DNS issues if Privoxy was compiled with IPv6 support. + + + + + Adjust url_code_map[] so spaces are replaced with %20 instead of '+' + While '+' can be used by client's submitting form data, this is not + actually what Privoxy is using the lookups for. This is more of a + cosmetic issue and doesn't fix any known problems. + + + + + When compiled without FEATURE_FAST_REDIRECTS, do not silently + ignore +fast-redirect{} directives + + + + + Added a workaround for GNU libc's strptime() reporting negative + year values when the parsed year is only specified with two digits. + On affected systems cookies with such a date would not be turned + into session cookies by the +session-cookies-only action. + Reported by Vaeinoe in #3403560 + + + + + Fixed bind failures with certain GNU libc versions if no non-loopback + IP address has been configured on the system. This is mainly an issue + if the system is using DHCP and Privoxy is started before the network + is completely configured. + Reported by Raphael Marichez in #3349356. + Additional insight from Petr Pisar. + + + + + Privoxy log messages now use the ISO 8601 date format %Y-%m-%d. + It's only slightly longer than the old format, but contains + the full date including the year and allows sorting by date + (when grepping in multiple log files) without hassle. + + + + + In get_last_url(), do not bother trying to decode URLs that do + not contain at least one '%' sign. It reduces the log noise and + a number of unnecessary memory allocations. + + + + + In case of SOCKS5 failures, dump the socks response in the log message. + + + + + Simplify the signal setup in main(). + + + + + Streamline socks5_connect() slightly. + + + + + In socks5_connect(), require a complete socks response from the server. + Previously Privoxy didn't care how much data the server response + contained as long as the first two bytes contained the expected + values. While at it, shrink the buffer size so Privoxy can't read + more than a whole socks response. + + + + + In chat(), do not bother to generate a client request in case of + direct CONNECT requests. It will not be used anyway. + + + + + Reduce server_last_modified()'s stack size. + + + + + Shorten get_http_time() by using strftime(). + + + + + Constify the known_http_methods pointers in unknown_method(). + + + + + Constify the time_formats pointers in parse_header_time(). + + + + + Constify the formerly_valid_actions pointers in action_used_to_be_valid(). + + + + + Introduce a GNUMakefile MAN_PAGE variable that defaults to privoxy.1. + The Debian package uses section 8 for the man page and this + should simplify the patch. + + + + + Deduplicate the INADDR_NONE definition for Solaris by moving it to jbsockets.h + + + + + In block_url(), ditch the obsolete workaround for ancient Netscape versions + that supposedly couldn't properly deal with status code 403. + + + + + Remove a useless NULL pointer check in load_trustfile(). + + + + + Remove two useless NULL pointer checks in load_one_re_filterfile(). + + + + + Change url_code_map[] from an array of pointers to an array of arrays + It removes an unnecessary layer of indirection and on 64bit system reduces + the size of the binary a bit. + + + + + Fix various typos. Fixes taken from Debian's 29_typos.dpatch by Roland Rosenfeld. + + + + + Add a dok-tidy GNUMakefile target to clean up the messy HTML + generated by the other dok targets. + + + + + GNUisms in the GNUMakefile have been removed. + + + + + Change the HTTP version in static responses to 1.1 + + + + + Synced config.sub and config.guess with upstream + 2011-11-11/386c7218162c145f5f9e1ff7f558a3fbb66c37c5. + + + + + Add a dedicated function to parse the values of toggles. Reduces duplicated + code in load_config() and provides better error handling. Invalid or missing + toggle values are now a fatal error instead of being silently ignored. + + + + + Terminate HTML lines in static error messages with \n instead of \r\n. + + + + + Simplify cgi_error_unknown() a bit. + + + + + In LogPutString(), don't bother looking at pszText when not + actually logging anything. + + + + + Change ssplit()'s fourth parameter from int to size_t. + Fixes a clang complaint. + + + + + Add a warning that the statistics currently can't be trusted. + Mention Privoxy-Log-Parser's --statistics option as + an alternative for the time being. + + + + + In rfc2553_connect_to(), start setting cgi->error_message on error. + + + + + Change the expected status code returned for http://p.p/die depending + on whether or not FEATURE_GRACEFUL_TERMINATION is available. + + + + + In cgi_die(), mark the client connection for closing. + If the client will fetch the style sheet through another connection + it gets the main thread out of the accept() state and should thus + trigger the actual shutdown. + + + + + Add a proper CGI message for cgi_die(). + + + + + Don't enforce a logical line length limit in read_config_line(). + + + + + Slightly refactor server_last_modified() to remove useless gmtime*() calls. + + + + + In get_content_type(), also recognize '.jpeg' as JPEG extension. + + + + + Add '.png' to the list of recognized file extensions in get_content_type(). + + + + + In block_url(), consistently use the block reason "Request blocked by Privoxy" + In two places the reason was "Request for blocked URL" which hides the + fact that the request got blocked by Privoxy and isn't necessarily + correct as the block may be due to tags. + + + + + In listen_loop(), reload the configuration files after accepting + a new connection instead of before. + Previously the first connection that arrived after a configuration + change would still be handled with the old configuration. + + + + + In chat()'s receive-data loop, skip a client socket check if + the socket will be written to right away anyway. This can + increase the transfer speed for unfiltered content on fast + network connections. + + + + + The socket timeout is used for SOCKS negotiations as well which + previously couldn't timeout. + + + + + Don't keep the client connection alive if any configuration file + changed since the time the connection came in. This is closer to + Privoxy's behaviour before keep-alive support for client connection + has been added and also less confusing in general. + + + + + Treat all Content-Type header values containing the pattern + 'script' as a sign of text. Reported by pribog in #3134970. + + + - CGI interface improvements: + Action file improvements: - In finish_http_response(), continue to add the 'Connection: close' - header if the client connection will not be kept alive. - Anonymously pointed out in #2987454. + Moved the site-specific block pattern section below the one for the + generic patterns so for requests that are matched in both, the block + reason for the domain is shown which is usually more useful than showing + the one for the generic pattern. + + + + + Remove -prevent-compression from the fragile alias. It's no longer + used anywhere by default and isn't known to break stuff anyway. + + + + + Add a (disabled) section to block various Facebook tracking URLs. + Reported by Dan Stahlke in #3421764. + + + + + Add a (disabled) section to rewrite and redirect click-tracking + URLs used on news.google.com. + Reported by Dan Stahlke in #3421755. + + + + + Unblock linuxcounter.net/. + Reported by Dan Stahlke in #3422612. + + + + + Block 'www91.intel.com/' which is used by Omniture. + Reported by Adam Piggott in #3167370. + + + + + Disable the handle-as-empty-doc-returns-ok option and mark it as deprecated. + Reminded by tceverling in #2790091. + + + + + Add ".ivwbox.de/" to the "Cross-site user tracking" section. + Reported by Nettozahler in #3172525. + + + + + Unblock and fast-redirect ".awin1.com/.*=http://". + Reported by Adam Piggott in #3170921. + + + + + Block "b.collective-media.net/". + + + + + Widen the Debian popcon exception to "qa.debian.org/popcon". + Seen in Debian's 05_default_action.dpatch by Roland Rosenfeld. - Apostrophes in block messages no longer cause parse errors - when the blocked page is viewed with JavaScript enabled. - Reported by dg1727 in #3062296. + Block ".gemius.pl/" which only seems to be used for user tracking. + Reported by johnd16 in #3002731. Additional input from Lee and movax. - Fix a bunch of anchors that used underscores instead of dashes. + Disable banners-by-size filters for '.thinkgeek.com/'. + The filter only seems to catch pictures of the inventory. - Allow to keep the client connection alive after crunching the previous request. - Already opened server connections can be kept alive, too. + Block requests for 'go.idmnet.bbelements.com/please/showit/'. + Reported by kacperdominik in #3372959. - In cgi_show_url_info(), don't forget to prefix URLs that only contain - http:// or https:// in the path. Fixes #2975765 reported by Adam Piggott. + Unblock adainitiative.org/. - Show the 404 CGI page if cgi_send_user_manual() is called while - local user manual delivery is disabled. + Add a fast-redirects exception for '.googleusercontent.com/.*=cache'. + + + + Add a fast-redirects exception for webcache.googleusercontent.com/. + + + + + Unblock http://adassier.wordpress.com/ and http://adassier.files.wordpress.com/. + + - Action file improvements: + Filter file improvements: - Enable user.filter by default. Suggested by David White in #3001830. + Let the yahoo filter hide '.ads'. - Block .sitestat.com/. Reported by johnd16 in #3002725. + Let the msn filter hide overlay ads for Facebook 'likes' in search + results and elements with the id 's_notf_div'. They only seem to be + used to advertise site 'enhancements'. - Block .atemda.com/. Reported by johnd16 in #3002723. + Let the js-events filter additionally disarm setInterval(). + Suggested by dg1727 in #3423775. - + + + + + + + Documentation improvements: + - Block js.adlink.net/. Reported by johnd16 in #3002720. + Clarify the effect of compiling Privoxy with zlib support. + Suggested by dg1727 in #3423782. - Block .analytics.yahoo.com/. Reported by johnd16 in #3002713. + Point out that the SourceForge messaging system works like a black + hole and should thus not be used to contact individual developers. - Block sb.scorecardresearch.com, too. Reported by dg1727 in #2992652. + Mention some of the problems one can experience when not explicitly + configuring an IP addresses as listen address. - Fix problems noticed on Yahoo mail and news pages. + Explicitly mention that hostnames can be used instead of IP addresses + for the listen-address, that only the first address returned will be + used and what happens if the address is invalid. + Requested by Calestyo in #3302213. - + + + + + + + Log message improvements: + - Remove the too broad yahoo section, only keeping the - fast-redirects exception as discussed on ijbswa-devel@. + If only the server connection is kept alive, do not pretend to + wait for a new client request. - Don't block adesklets.sourceforge.net. Reported in #2974204. + Remove a superfluous log message in forget_connection(). - Block chartbeat ping tracking. Reported in #2975895. + In chat(), properly report missing server responses as such + instead of calling them empty. - Tag CSS and image requests with cautious and medium settings, too. + In forwarded_connect(), fix a log message nobody should ever see. - Don't handle view.atdmt.com as image. It's used for click-throughs - so users should be able to "go there anyway". - Reported by Adam Piggott in #2975927. + Fix a log message in socks5_connect(), a failed write operation + was logged as failed read operation. - Also let the refresh-tags filter remove invalid refresh tags where - the 'url=' part is missing. Anonymously reported in #2986382. - While at it, update the description to mention the fact that only - refresh tags with refresh times above 9 seconds are covered. + Let load_one_actions_file() properly complain about a missing + '{' at the beginning of the file. + Simply stating that a line is invalid isn't particularly helpful. - javascript needs to be blocked with +handle-as-empty-document to - work around Firefox bug 492459. So move .js blockers from - +block{Might be a web-bug.} -handle-as-empty-document to - +block{Might be a web-bug.} +handle-as-empty-document. + Do not claim to listen on a socket until Privoxy actually does. + Patch submitted by Petr Pisar #3354485 - ijbswa-Feature Requests-3006719 - Block 160x578 Banners. + Prevent a duplicated LOG_LEVEL_CLF message when sending out + the "no-server-data" response. - Block another omniture tracking domain. + Also log the client socket when dropping a connection. - Added a range-requests tagger. + Include the destination host in the 'Request ... marked for + blocking. limit-connect{...} doesn't allow CONNECT ...' message + Patch submitted by Saperski in #3296250. - Added two sections to get Flickr's Ajax interface working with - default pre-settings. If you change the configuration to block - cookies by default, you'll need additional exceptions. - Reported by Mathias Homann in #3101419 and by Patrick on ijbswa-users@. - - - - - - - Documentation improvements: - - - - Explicitly mention how to match all URLs. + Prevent a duplicated log message if none of the resolved IP + addresses were reachable. - Consistently recommend socks5 in the Tor FAQ entry and mention - its advantage compared to socks4a. Reported by David in #2960129. + In connect_to(), do not pretend to retry if forwarded-connect-retries + is zero or unset. - Slightly improve the explanation of why filtering may appear - slower than it is. + When a specified user or group can't be found, put the name in + single-quotes when logging it. - Grammar fixes for the ACL section. + In rfc2553_connect_to(), explain getnameinfo() errors better. - Fixed a link to the 'intercepting' entry and add another one. + Remove a useless log message in chat(). - Rename the 'Other' section to 'Mailing Lists' and reword it - to make it clear that nobody is forced to use the trackers + When retrying to connect, also log the maximum number of connection + attempts. - Note that 'anonymously' posting on the trackers may not always - be possible. + Rephrase a log message in compile_dynamic_pcrs_job_list(). + Divide the error code and its meaning with a colon. Call the pcrs + job dynamic and not the filter. Filters may contain dynamic and + non-dynamic pcrs jobs at the same time. Only mention the name of + the filter or tagger, but don't claim it's a filter when it could + be a tagger. - Suggest to enable debug 32768 when suspecting parsing problems. + In a fatal error message in load_one_actions_file(), cover both + URL and TAG patterns. - - - - - - Privoxy-Log-Parser improvements: - + - Gather statistics for ressources, methods, and HTTP versions - used by the client. + In pcrs_strerror(), properly report unknown positive error code + values as such. Previously they were handled like 0 (no error). - Also gather statistics for blocked and redirected requests. + In compile_dynamic_pcrs_job_list(), also log the actual error code as + pcrs_strerror() doesn't handle all errors reported by pcre. - Provide the percentage of keep-alive offers the client accepted. + Don't bother trying to continue chatting if the client didn't ask for it. + Reduces log noise a bit. - Add a --url-statistics-threshold option. + Make two fatal error message in load_one_actions_file() more descriptive. - Add a --host-statistics-threshold option to also gather - statistics about how many request where made per host. + In cgi_send_user_manual(), log when rejecting a file name due to '/' or '..'. - Fix a bug in handle_loglevel_header() where a 'scan: ' got lost. + In load_file(), log a message if opening a file failed. + The CGI error message alone isn't too helpful. - Add a --shorten-thread-ids option to replace the thread id with - a decimal number. + In connection_destination_matches(), improve two log messages + to help understand why the destinations don't match. - Accept and ignore: Looks like we got the last chunk together - with the server headers. We better stop reading. + Rephrase a log message in serve(). Client request arrival + should be differentiated from closed client connections now. - Accept and ignore: Continue hack in da house. + In serve(), log if a client connection isn't reused due to a + configuration file change. - Accept and higlight: Rejecting connection from 10.0.0.2. - Maximum number of connections reached. + Let mark_server_socket_tainted() always mark the server socket tainted, + just don't talk about it in cases where it has no effect. It doesn't change + Privoxy's behaviour, but makes understanding the log file easier. - + + + + + + + configure: + - Accept and highlight: Loading actions file: /usr/local/etc/privoxy/default.action + Added a --disable-ipv6-support switch for platforms where support + is detected but doesn't actually work. - Accept and highlight: Loading filter file: /usr/local/etc/privoxy/default.filter + Do not check for the existence of strerror() and memmove() twice - Accept and highlight: Killed all-caps Host header line: HOST: bestproxydb.com + Remove a useless test for setpgrp(2). Privoxy doesn't need it and + it can cause problems when cross-compiling. - Accept and highlight: Reducing expected bytes to 0. Marking - the server socket tainted after throwing 4 bytes away. + Rename the --disable-acl-files switch to --disable-acl-support. + Since about 2001, ACL directives are specified in the standard + config file. - Accept: Merged multiple header lines to: 'X-FORWARDED-PROTO: http X-HOST: 127.0.0.1' + Update the URL of the 'Removing outdated PCRE version after the + next stable release' posting. The old URL stopped working after + one of SF's recent site "optimizations". Reported by Han Liu. + - Code cleanups: + Privoxy-Regression-Test: - Remove the next member from the client_state struct. Only the main - thread needs access to all client states so give it its own struct. + Added --shuffle-tests option to increase the chances of detection race conditions. - Garbage-collect request_contains_null_bytes(). + Added a --local-test-file option that allows to use Privoxy-Regression-Test without Privoxy. - Ditch redundant code in unload_configfile(). + Added tests for missing socks4 and socks4a forwarders. - Ditch LogGetURLUnderCursor() which doesn't seem to be used anywhere. + The --privoxy-address option now works with IPv6 addresses containing brackets, too. - In write_socket(), remove the write-only variable write_len in - an ifdef __OS2__ block. Spotted by cppcheck. + Perform limited sanity checks for parameters that are supposed to have numerical values. - In connect_to(), don't declare the variable 'flags' on OS/2 where - it isn't used. Spotted by cppcheck. + Added a --sleep-time option to specify a number of seconds to + sleep between tests, defaults to 0. - Limit the scope of various variables. Spotted by cppcheck. + Disable the range-requests tagger for tests that break if it's enabled. - In add_to_iob(), turn an interestingly looking for loop into a - boring while loop. + Log messages use the ISO 8601 date format %Y-%m-%d. - Code cleanup in preparation for external filters. + Fix spelling in two error messages. - In listen_loop(), mention the socket on which we accepted the - connection, not just the source IP address. + In the --help output, include a list of supported tests and their default levels. - In write_socket(), also log the socket we're writing to. + Adjust the tests to properly deal with FEATURE_TOGGLE being disabled. - + + + + + + + Privoxy-Log-Parser: + - In log_error(), assert that escaped characters get logged - completely or not at all. + Perform limited sanity checks for command line parameters that + are supposed to have numerical values. - In log_error(), assert that ival and sval have reasonable values. - There's no reason not to abort() if they don't. + Implement a --unbreak-lines-only option to try to revert MUA breakage. - Remove an incorrect cgi_error_unknown() call in a - cannnot-happen-situation in send_crunch_response(). + Accept and highlight: Added header: Content-Encoding: deflate - Clean up white-space in http_response definition and - move the crunch_reason to the beginning. + Accept and highlight: Compressed content from 29258 to 8630 bytes. - Turn http_response.reason into an enum and rename it - to http_response.crunch_reason. + Accept and highlight: Client request arrived in time on socket 21. - Silence a 'gcc (Debian 4.3.2-1.1) 4.3.2' warning on i686 GNU/Linux. + Highlight: Didn't receive data in time: a.fsdn.com:443 - Fix white-space in a log message in remove_chunked_transfer_coding(). - While at it, add a note that the message doesn't seem to - be entirely correct and should be improved later on. + Accept log messages with ISO 8601 time stamps, too. + - GNUmakefile improvements: + uagen: - Use $(SSH) instead of ssh, so one only needs to specify a username once. - - - - - Removed references to the action feedback thingy that hasn't been - working for years. - - - - - Consistently use shell.sourceforge.net instead of shell.sf.net so - one doesn't need to check server fingerprints twice. + Bump generated Firefox version to 8.0. - Removed GNUisms in the webserver and webactions targets so they - work with standard tar. + Only randomize the release date if the new --randomize-release-date + option is enabled. Firefox versions after 4 use a fixed date string + without meaning. + @@ -953,7 +1475,7 @@ Note to Upgraders - A quick list of things to be aware of before upgrading from earlier + A quick list of things to be aware of before upgrading from earlier versions of Privoxy: @@ -962,7 +1484,7 @@ - The recommended way to upgrade &my-app; is to backup your old + The recommended way to upgrade &my-app; is to backup your old configuration files, install the new ones, verify that &my-app; is working correctly and finally merge back your changes using diff and maybe patch. @@ -976,20 +1498,20 @@ - + Note that some installers remove earlier versions completely, including configuration files, therefore you should really save any important configuration files! - - On the other hand, other installers don't overwrite existing configuration + + On the other hand, other installers don't overwrite existing configuration files, thinking you will want to do that yourself. - + standard.action has been merged into the default.action file. @@ -1006,21 +1528,21 @@ - Three other config file settings are now off by default: + Three other config file settings are now off by default: enable-remote-toggle, enable-remote-http-toggle, - and enable-edit-actions. + and enable-edit-actions. If you use or want these, you will need to explicitly enable them, and - be aware of the security issues involved. + be aware of the security issues involved. @@ -1094,19 +1616,19 @@ Install Privoxy. See the Installation Section below for platform specific - information. + information. - + Advanced users and those who want to offer Privoxy service to more than just their local machine should check the main config file, especially the security-relevant options. These are + linkend="access-control">security-relevant options. These are off by default. - + @@ -1122,26 +1644,26 @@ HTTPS (SSL) proxy by setting the proxy configuration for address of 127.0.0.1 and port 8118. - DO NOT activate proxying for FTP or + DO NOT activate proxying for FTP or any protocols besides HTTP and HTTPS (SSL) unless you intend to prevent your browser from using these protocols. - + Flush your browser's disk and memory caches, to remove any cached ad images. - If using Privoxy to manage + If using Privoxy to manage cookies, you should remove any currently stored cookies too. - + - A default installation should provide a reasonable starting point for + A default installation should provide a reasonable starting point for most. There will undoubtedly be occasions where you will want to adjust the - configuration, but that can be dealt with as the need arises. Little + configuration, but that can be dealt with as the need arises. Little to no initial configuration is required in most cases, you may want to enable the web-based action editor though. @@ -1155,7 +1677,7 @@ introduction to how Privoxy blocks ads and banners. - + @@ -1170,7 +1692,7 @@ Action has hints on how to understand and debug actions that misbehave. - + Please see the section Contacting the Developers on how to report bugs, problems with websites or to get - help. + help. - + Now enjoy surfing with enhanced control, comfort and privacy! - + @@ -1207,35 +1729,35 @@ Quickstart to Ad Blocking Ad blocking is but one of Privoxy's - array of features. Many of these features are for the technically minded advanced + array of features. Many of these features are for the technically minded advanced user. But, ad and banner blocking is surely common ground for everybody. - - This section will provide a quick summary of ad blocking so + + This section will provide a quick summary of ad blocking so you can get up to speed quickly without having to read the more extensive information provided below, though this is highly recommended. First a bit of a warning ... blocking ads is much like blocking SPAM: the - more aggressive you are about it, the more likely you are to block - things that were not intended. And the more likely that some things + more aggressive you are about it, the more likely you are to block + things that were not intended. And the more likely that some things may not work as intended. So there is a trade off here. If you want extreme ad free browsing, be prepared to deal with more problem sites, and to spend more time adjusting the - configuration to solve these unintended consequences. In short, there is - not an easy way to eliminate all ads. Either take + configuration to solve these unintended consequences. In short, there is + not an easy way to eliminate all ads. Either take the easy way and settle for most ads blocked with the default configuration, or jump in and tweak it for your personal surfing habits and preferences. Secondly, a brief explanation of Privoxy's - actions. Actions in this context, are + actions. Actions in this context, are the directives we use to tell Privoxy to perform some task relating to HTTP transactions (i.e. web browsing). We tell Privoxy to take some action. Each @@ -1247,7 +1769,7 @@ Actions are specified in Privoxy's configuration, - followed by one or more URLs to which the action should apply. URLs + followed by one or more URLs to which the action should apply. URLs can actually be URL type patterns that use wildcards so they can apply potentially to a range of similar URLs. The actions, together with the URL patterns are called a section. @@ -1270,7 +1792,7 @@ The most important actions for basic ad blocking are: block, handle-as-image, + linkend="handle-as-image">handle-as-image, handle-as-empty-document,and set-image-blocker: @@ -1278,10 +1800,10 @@ - + - block - this is perhaps + block - this is perhaps the single most used action, and is particularly important for ad blocking. This action stops any contact between your browser and any URL patterns that match this action's configuration. It can be used for blocking ads, @@ -1290,32 +1812,32 @@ Privoxy's own built-in BLOCKED page instead to let you now what has happened (with some exceptions, see below). - + - handle-as-image - + handle-as-image - tells Privoxy to treat this URL as an image. Privoxy's default configuration already does this for all common image types (e.g. GIF), but there are many situations where this is not so easy to determine. So we'll force it in these cases. This is particularly important for ad blocking, since only if we know that it's an image of - some kind, can we replace it with an image of our choosing, instead of the + some kind, can we replace it with an image of our choosing, instead of the Privoxy BLOCKED page (which would only result in a broken image icon). There are some limitations to this though. For instance, you can't just brute-force an image substitution for an entire HTML page in most situations. - + - handle-as-empty-document - - sends an empty document instead of Privoxy's - normal BLOCKED HTML page. This is useful for file types that are neither + handle-as-empty-document - + sends an empty document instead of Privoxy's + normal BLOCKED HTML page. This is useful for file types that are neither HTML nor images, such as blocking JavaScript files. - + @@ -1332,7 +1854,7 @@ -    pattern - a checkerboard pattern, so that an ad +    pattern - a checkerboard pattern, so that an ad replacement is obvious. This is the default. @@ -1348,14 +1870,14 @@ of the user's choosing (advanced usage). - + Advanced users will eventually want to explore &my-app; - filters as well. Filters + filters as well. Filters are very different from blocks. A block blocks a site, page, or unwanted contented. Filters @@ -1370,7 +1892,7 @@ The quickest way to adjust any of these settings is with your browser through the special Privoxy editor at http://config.privoxy.org/show-status - (shortcut: http://p.p/show-status). This + (shortcut: http://p.p/show-status). This is an internal page, and does not require Internet access. @@ -1402,21 +1924,21 @@ - Right click on the ad image to be blocked, then select + Right click on the ad image to be blocked, then select Copy Link Location from the - pop-up menu. + pop-up menu. - + - Set your browser to + Set your browser to http://config.privoxy.org/show-status - + - Find user.action in the top section, and click + Find user.action in the top section, and click on Edit: @@ -1426,29 +1948,29 @@ - + [ Screenshot of Actions Files in Use ] - - + + You should have a section with only - block listed under + block listed under Actions:. If not, click a Insert new section below - button, and in the new section that just appeared, click the + button, and in the new section that just appeared, click the Edit button right under the word Actions:. This will bring up a list of all actions. Find block near the top, and click in the Enabled column, then Submit just below the list. - + Now, in the block actions section, @@ -1458,21 +1980,21 @@ Submit (or OK if in a pop-up window). - + Now go back to the original page, and press SHIFT-Reload (or flush all browser caches). The image should be gone now. - - + + - This is a very crude and simple example. There might be good reasons to use a + This is a very crude and simple example. There might be good reasons to use a wildcard pattern match to include potentially similar images from the same - site. For a more extensive explanation of patterns, and + site. For a more extensive explanation of patterns, and the entire actions concept, see the Actions section. @@ -1483,11 +2005,11 @@ The ideas explained therein also apply to the web-based editor. - There are also various - filters that can be used for ad blocking - (filters are a special subset of actions). These + There are also various + filters that can be used for ad blocking + (filters are a special subset of actions). These fall into the advanced usage category, and are explained in - depth in later sections. + depth in later sections. @@ -1503,14 +2025,14 @@ Before launching Privoxy for the first time, you will want to configure your browser(s) to use - Privoxy as a HTTP and HTTPS (SSL) + Privoxy as a HTTP and HTTPS (SSL) proxy. The default is 127.0.0.1 (or localhost) for the proxy address, and port 8118 (earlier versions used port 8000). This is the one configuration step that must be done ! - Please note that Privoxy can only proxy HTTP and + Please note that Privoxy can only proxy HTTP and HTTPS traffic. It will not work with FTP or other protocols. @@ -1521,35 +2043,35 @@ - + [ Screenshot of Mozilla Proxy Configuration ] - - + + With Firefox, this is typically set under: - + Tools -> Options -> Advanced -> Network ->Connection -> Settings - + Or optionally on some platforms: - + Edit -> Preferences -> General -> Connection Settings -> Manual Proxy Configuration - + With Netscape (and Mozilla), this can be set under: @@ -1563,7 +2085,7 @@ - For Internet Explorer v.5-7: + For Internet Explorer v.5-7: @@ -1585,7 +2107,7 @@ - + [ Screenshot of IE Proxy Configuration ] @@ -1596,7 +2118,7 @@ After doing this, flush your browser's disk and memory caches to force a - re-reading of all pages and to get rid of any ads that may be cached. Remove + re-reading of all pages and to get rid of any ads that may be cached. Remove any cookies, if you want Privoxy to manage that. You are now ready to start enjoying the benefits of using @@ -1660,7 +2182,7 @@ Privoxy can run with full Windows service functionality. On Windows only, the &my-app; program has two new command line arguments - to install and uninstall &my-app; as a service. See the + to install and uninstall &my-app; as a service. See the Windows Installation instructions for details. @@ -1727,7 +2249,7 @@ Start Privoxy (with RUN <>NIL:) in your startnet script (AmiTCP), in s:user-startup (RoadShow), as startup program in your - startup script (Genesis), or as startup action (Miami and MiamiDx). + startup script (Genesis), or as startup action (Miami and MiamiDx). Privoxy will automatically quit when you quit your TCP/IP stack (just ignore the harmless warning your TCP/IP stack may display that Privoxy is still running). @@ -1737,7 +2259,7 @@ Gentoo - A script is again used. It will use the file /etc/privoxy/config + A script is again used. It will use the file /etc/privoxy/config as its main configuration file. @@ -1746,11 +2268,11 @@ - Note that Privoxy is not automatically started at - boot time by default. You can change this with the rc-update + Note that Privoxy is not automatically started at + boot time by default. You can change this with the rc-update command. - + rc-update add privoxy default @@ -1772,7 +2294,7 @@ actions files. These are where various cookie actions are defined, ad and banner blocking, and other aspects of Privoxy configuration. There are several - such files included, with varying levels of aggressiveness. + such files included, with varying levels of aggressiveness. @@ -1792,7 +2314,7 @@ sites is the popup-killing (through +filter{popups}), because your favorite shopping, banking, or leisure site may need - popups (explained below). + popups (explained below). @@ -1808,24 +2330,24 @@ - After running Privoxy for a while, you can - start to fine tune the configuration to suit your personal, or site, - preferences and requirements. There are many, many aspects that can - be customized. Actions - can be adjusted by pointing your browser to + After running Privoxy for a while, you can + start to fine tune the configuration to suit your personal, or site, + preferences and requirements. There are many, many aspects that can + be customized. Actions + can be adjusted by pointing your browser to http://config.privoxy.org/ - (shortcut: http://p.p/), - and then follow the link to View & Change the Current Configuration. + (shortcut: http://p.p/), + and then follow the link to View & Change the Current Configuration. (This is an internal page and does not require Internet access.) In fact, various aspects of Privoxy - configuration can be viewed from this page, including - current configuration parameters, source code version numbers, - the browser's request headers, and actions that apply - to a given URL. In addition to the actions file - editor mentioned above, Privoxy can also + configuration can be viewed from this page, including + current configuration parameters, source code version numbers, + the browser's request headers, and actions that apply + to a given URL. In addition to the actions file + editor mentioned above, Privoxy can also be turned on and off (toggled) from this page. @@ -1848,9 +2370,9 @@ If you can't get rid of the problem at all, think you've found a bug in - Privoxy, want to propose a new feature or smarter rules, please see the + Privoxy, want to propose a new feature or smarter rules, please see the section Contacting the - Developers below. + Developers below. --> @@ -1873,7 +2395,7 @@ Print version info and exit. Unix only. - + --help @@ -1881,7 +2403,7 @@ Print short usage info and exit. Unix only. - + --no-daemon @@ -1890,7 +2412,7 @@ Don't become a daemon, i.e. don't fork and become process group leader, and don't detach from controlling tty. Unix only. - + --pidfile FILE @@ -1901,7 +2423,7 @@ FILE is non-fatal. If no FILE option is given, no PID file will be used. Unix only. - + --user USER[.GROUP] @@ -1917,9 +2439,9 @@ --chroot - Before changing to the user ID given in the --user option, + Before changing to the user ID given in the --user option, chroot to that user's home directory, i.e. make the kernel pretend to the &my-app; - process that the directory tree starts there. If set up carefully, this can limit + process that the directory tree starts there. If set up carefully, this can limit the impact of possible vulnerabilities in &my-app; to the files contained in that hierarchy. Unix only. @@ -1947,23 +2469,23 @@ configfile - If no configfile is included on the command line, - Privoxy will look for a file named - config in the current directory (except on Win32 - where it will look for config.txt instead). Specify - full path to avoid confusion. If no config file is found, + If no configfile is included on the command line, + Privoxy will look for a file named + config in the current directory (except on Win32 + where it will look for config.txt instead). Specify + full path to avoid confusion. If no config file is found, Privoxy will fail to start. - + - On MS Windows only there are two additional - command-line options to allow Privoxy to install and - run as a service. See the -Window Installation section + On MS Windows only there are two additional + command-line options to allow Privoxy to install and + run as a service. See the +Window Installation section for details. @@ -1977,9 +2499,9 @@ Privoxy Configuration - All Privoxy configuration is stored + All Privoxy configuration is stored in text files. These files can be edited with a text editor. - Many important aspects of Privoxy can + Many important aspects of Privoxy can also be controlled easily with a web browser. @@ -1989,9 +2511,9 @@ Controlling Privoxy with Your Web Browser - Privoxy's user interface can be reached through the special + Privoxy's user interface can be reached through the special URL http://config.privoxy.org/ - (shortcut: http://p.p/), + (shortcut: http://p.p/), which is a built-in page and works without Internet access. You will see the following section: @@ -2033,14 +2555,14 @@ cookie, and URL blocking magic is configured as well as other advanced features of Privoxy. This is an easy way to adjust various aspects of Privoxy configuration. The actions - file, and other configuration files, are explained in detail below. + file, and other configuration files, are explained in detail below. - Toggle Privoxy On or Off is handy for sites that might + Toggle Privoxy On or Off is handy for sites that might have problems with your current actions and filters. You can in fact use - it as a test to see whether it is Privoxy - causing the problem or not. Privoxy continues + it as a test to see whether it is Privoxy + causing the problem or not. Privoxy continues to run as a proxy in this case, but all manipulation is disabled, i.e. Privoxy acts like a normal forwarding proxy. There is even a toggle Bookmarklet offered, so @@ -2070,14 +2592,14 @@ For Unix, *BSD and Linux, all configuration files are located in /etc/privoxy/ by default. For MS Windows, OS/2, and - AmigaOS these are all in the same directory as the + AmigaOS these are all in the same directory as the Privoxy executable. - The installed defaults provide a reasonable starting point, though + The installed defaults provide a reasonable starting point, though some settings may be aggressive by some standards. For the time being, the principle configuration files are: @@ -2091,7 +2613,7 @@ on Linux, Unix, BSD, OS/2, and AmigaOS and config.txt on Windows. This is a required file. - + @@ -2105,23 +2627,23 @@ It should be the second actions file loaded and shouldn't be edited by the user. - Multiple actions files may be defined in config. These - are processed in the order they are defined. Local customizations and locally + Multiple actions files may be defined in config. These + are processed in the order they are defined. Local customizations and locally preferred exceptions to the default policies as defined in match-all.action (which you will most probably want to define sooner or later) are best applied in user.action, where you can preserve them across upgrades. The file isn't installed by all installers, but you can easily create it yourself with a text editor. - + There is also a web based editor that can be accessed from http://config.privoxy.org/show-status (Shortcut: http://p.p/show-status) for the - various actions files. + various actions files. - + @@ -2129,15 +2651,15 @@ file) can be used to re-write the raw page content, including viewable text as well as embedded HTML and JavaScript, and whatever else lurks on any given web page. The filtering jobs are only pre-defined here; - whether to apply them or not is up to the actions files. - default.filter includes various filters made - available for use by the developers. Some are much more intrusive than - others, and all should be used with caution. You may define additional - filter files in config as you can with - actions files. We suggest user.filter for any + whether to apply them or not is up to the actions files. + default.filter includes various filters made + available for use by the developers. Some are much more intrusive than + others, and all should be used with caution. You may define additional + filter files in config as you can with + actions files. We suggest user.filter for any locally defined filters or customizations. - + @@ -2159,15 +2681,15 @@ - The actions files and filter files + The actions files and filter files can use Perl style regular expressions for - maximum flexibility. + maximum flexibility. After making any changes, there is no need to restart Privoxy in order for the changes to take - effect. Privoxy detects such changes + effect. Privoxy detects such changes automatically. Note, however, that it may take one or two additional requests for the change to take effect. When changing the listening address of Privoxy, these wake up requests @@ -2176,9 +2698,9 @@ - While under development, the configuration content is subject to change. - The below documentation may not be accurate by the time you read this. - Also, what constitutes a default setting, may change, so + While under development, the configuration content is subject to change. + The below documentation may not be accurate by the time you read this. + Also, what constitutes a default setting, may change, so please check all your configuration files on important issues. ]]> @@ -2214,15 +2736,15 @@ The actions files are used to define what actions Privoxy takes for which URLs, and thus determines how ad images, cookies and various other aspects of HTTP content and - transactions are handled, and on which sites (or even parts thereof). + transactions are handled, and on which sites (or even parts thereof). There are a number of such actions, with a wide range of functionality. Each action does something a little different. - These actions give us a veritable arsenal of tools with which to exert - our control, preferences and independence. Actions can be combined so that + These actions give us a veritable arsenal of tools with which to exert + our control, preferences and independence. Actions can be combined so that their effects are aggregated when applied against a given set of URLs. - + - There + There are three action files included with Privoxy with differing purposes: @@ -2235,7 +2757,7 @@ content modification, cookie handling etc should be applied by default. It should be the first actions file loaded - + default.action - defines many exceptions (both @@ -2244,15 +2766,15 @@ work reasonably well as-is for most users. This file is only supposed to be edited by the developers. It should be the second actions file loaded. - + - user.action - is intended to be for local site + user.action - is intended to be for local site preferences and exceptions. As an example, if your ISP or your bank - has specific requirements, and need special handling, this kind of + has specific requirements, and need special handling, this kind of thing should go here. This file will not be upgraded. - + Edit Set to Cautious Set to Medium Set to Advanced @@ -2260,16 +2782,16 @@ These have increasing levels of aggressiveness and have no influence on your browsing unless you select them explicitly in the - editor. A default installation should be pre-set to + editor. A default installation should be pre-set to Cautious. New users should try this for a while before - adjusting the settings to more aggressive levels. The more aggressive - the settings, then the more likelihood there is of problems such as sites + adjusting the settings to more aggressive levels. The more aggressive + the settings, then the more likelihood there is of problems such as sites not working as they should. - The Edit button allows you to turn each + The Edit button allows you to turn each action on/off individually for fine-tuning. The Cautious - button changes the actions list to low/safe settings which will activate + button changes the actions list to low/safe settings which will activate ad blocking and a minimal set of &my-app;'s features, and subsequently there will be less of a chance for accidental problems. The Medium button sets the list to a medium level of @@ -2340,7 +2862,7 @@ blocks only blocks only - + Privacy Features low @@ -2409,12 +2931,12 @@ - + - + - The list of actions files to be used are defined in the main configuration + The list of actions files to be used are defined in the main configuration file, and are processed in the order they are defined (e.g. default.action is typically processed before user.action). The content of these can all be viewed and @@ -2425,7 +2947,7 @@ (defined in default.action), followed by any exceptions (typically also in default.action), which are then followed lastly by any - local preferences (typically in user.action). + local preferences (typically in user.action). Generally, user.action has the last word. @@ -2435,7 +2957,7 @@ alias section at the top of that file. Then comes the default set of rules which will apply universally to all sites and pages (be very careful with using such a - universal set in user.action or any other actions file after + universal set in user.action or any other actions file after default.action, because it will override the result from consulting any previous file). And then below that, exceptions to the defined universal policies. You can regard @@ -2444,7 +2966,7 @@ personal settings across Privoxy upgrades easier. - + Actions can be used to block anything you want, including ads, banners, or just some obnoxious URL whose content you would rather not see. Cookies can be accepted or rejected, or accepted only during the current browser session (i.e. not @@ -2460,7 +2982,7 @@ Note that some actions, like cookie suppression or script disabling, may render some sites unusable that rely on these techniques to work properly. Finding the right mix of actions is not always easy and - certainly a matter of personal taste. And, things can always change, requiring + certainly a matter of personal taste. And, things can always change, requiring refinements in the configuration. In general, it can be said that the more aggressive your default settings (in the top section of the actions file) are, the more exceptions for trusted sites you @@ -2492,13 +3014,13 @@ like Cautious, Medium or Advanced. Warning: the Advanced setting is more aggressive, and will be more likely to cause problems for some sites. - Experienced users only! + Experienced users only! If you prefer plain text editing to GUIs, you can of course also directly edit the the actions files with your favorite text editor. Look at - default.action which is richly commented with many + default.action which is richly commented with many good examples. @@ -2526,12 +3048,12 @@ If multiple applying sections set the same action differently, the last match wins. If not, the effects are aggregated. - E.g. a URL might match a regular section with a heading line of { + E.g. a URL might match a regular section with a heading line of { +handle-as-image }, then later another one with just { +block }, resulting - in both actions to apply. And there may well be - cases where you will want to combine actions together. Such a section then + in both actions to apply. And there may well be + cases where you will want to combine actions together. Such a section then might look like: @@ -2558,7 +3080,7 @@ Patterns - + As mentioned, Privoxy uses patterns to determine what actions might apply to which sites and pages your browser attempts to access. These patterns use wild @@ -2566,7 +3088,7 @@ flexibility. This allows one expression to be expanded and potentially match against many similar patterns. - + Generally, an URL pattern has the form <domain><port>/<path>, where the @@ -2578,8 +3100,8 @@ The pattern matching syntax is different for the domain and path parts of - the URL. The domain part uses a simple globbing type matching technique, - while the path part uses more flexible + the URL. The domain part uses a simple globbing type matching technique, + while the path part uses more flexible Regular Expressions (POSIX 1003.2). @@ -2597,7 +3119,7 @@ is a domain-only pattern and will match any request to www.example.com, regardless of which document on that server is requested. So ALL pages in - this domain would be covered by the scope of this action. Note that a + this domain would be covered by the scope of this action. Note that a simple example.com is different and would NOT match. @@ -2669,7 +3191,7 @@ matches nothing, since it would be interpreted as a domain name and - there is no top-level domain called .html. So its + there is no top-level domain called .html. So its a mistake. @@ -2682,7 +3204,7 @@ The matching of the domain part offers some flexible options: if the - domain starts or ends with a dot, it becomes unanchored at that end. + domain starts or ends with a dot, it becomes unanchored at that end. For example: @@ -2720,7 +3242,7 @@ a domain.) This might be www.example.com, news.example.de, or www.example.net/cgi/testing.pl for instance. All these - cases are matched. + cases are matched. @@ -2730,12 +3252,12 @@ Additionally, there are wild-cards that you can use in the domain names themselves. These work similarly to shell globbing type wild-cards: * represents zero or more arbitrary characters (this is - equivalent to the + equivalent to the Regular Expression based syntax of .*), ? represents any single character (this is equivalent to the regular expression syntax of a simple .), and you can define - character classes in square brackets which is similar to + character classes in square brackets which is similar to the same regular expression technique. All of this can be freely mixed: @@ -2744,7 +3266,7 @@ ad*.example.com - matches adserver.example.com, + matches adserver.example.com, ads.example.com, etc but not sfads.example.com @@ -2762,7 +3284,7 @@ matches www.ipix.com, - pictures.epix.com, a.b.c.d.e.upix.com etc. + pictures.epix.com, a.b.c.d.e.upix.com etc. @@ -2770,9 +3292,9 @@ www[1-9a-ez].example.c* - matches www1.example.com, - www4.example.cc, wwwd.example.cy, - wwwz.example.com etc., but not + matches www1.example.com, + www4.example.cc, wwwd.example.cy, + wwwz.example.com etc., but not wwww.example.com. @@ -2806,13 +3328,13 @@ Note that the path pattern is automatically left-anchored at the /, - i.e. it matches as if it would start with a ^ (regular expression speak + i.e. it matches as if it would start with a ^ (regular expression speak for the beginning of a line). Please also note that matching in the path is CASE INSENSITIVE - by default, but you can switch to case sensitive at any point in the pattern by using the + by default, but you can switch to case sensitive at any point in the pattern by using the (?-i) switch: www.example.com/(?-i)PaTtErN.* will match only documents whose path starts with PaTtErN in exactly this capitalization. @@ -2823,7 +3345,7 @@ .example.com/.* - Is equivalent to just .example.com, since any documents + Is equivalent to just .example.com, since any documents within that domain are matched with or without the .* regular expression. This is redundant @@ -2837,9 +3359,9 @@ named index.html, and that is part of some path. For example, it matches www.example.com/testing/index.html but NOT www.example.com/index.html because the regular - expression called for at least two /'s, thus the path - requirement. It also would match - www.example.com/testing/index_html, because of the + expression called for at least two /'s, thus the path + requirement. It also would match + www.example.com/testing/index_html, because of the special meta-character .. @@ -2848,9 +3370,9 @@ .example.com/(.*/)?index\.html$ - This regular expression is conditional so it will match any page - named index.html regardless of path which in this case can - have one or more /'s. And this one must contain exactly + This regular expression is conditional so it will match any page + named index.html regardless of path which in this case can + have one or more /'s. And this one must contain exactly .html (but does not have to end with that!). @@ -2860,7 +3382,7 @@ This regular expression will match any path of example.com - that contains any of the words ads, banner, + that contains any of the words ads, banner, banners (because of the ?) or junk. The path does not have to end in these words, just contain them. @@ -2870,8 +3392,8 @@ .example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$ - This is very much the same as above, except now it must end in either - .jpg, .jpeg, .gif or .png. So this + This is very much the same as above, except now it must end in either + .jpg, .jpeg, .gif or .png. So this one is limited to common image formats. @@ -2879,7 +3401,7 @@ - There are many, many good examples to be found in default.action, + There are many, many good examples to be found in default.action, and more tutorials below in Appendix on regular expressions. @@ -2969,23 +3491,23 @@ - + Again, actions are invoked by placing them on a line, enclosed in curly braces and - separated by whitespace, like in + separated by whitespace, like in {+some-action -some-other-action{some-parameter}}, followed by a list of URL patterns, one per line, to which they apply. Together, the actions line and the following pattern lines make up a section - of the actions file. + of the actions file. - + Actions fall into three categories: - + Boolean, i.e the action can only be enabled or disabled. Syntax: @@ -2994,14 +3516,14 @@ +name # enable action name -name # disable action name - + Example: +handle-as-image - + Parameterized, where some value is required in order to enable this type of action. Syntax: @@ -3015,13 +3537,13 @@ Note that if the URL matches multiple positive forms of a parameterized action, the last match wins, i.e. the params from earlier matches are simply ignored. - + Example: +hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602 Firefox/2.0.0.4} - + - + Multi-value. These look exactly like parameterized actions, but they behave differently: If the action applies multiple times to the same URL, but with different parameters, all the parameters @@ -3036,7 +3558,7 @@ # If it was the last one left, disable the action. -name # disable this action completely and remove all parameters from the list - + Examples: +add-header{X-Fun-Header: Some text} and +filter{html-annoyances} @@ -3055,8 +3577,8 @@ Later defined action sections always over-ride earlier ones of the same type. - So exceptions to any rules you make, should come in the latter part of the file (or - in a file that is processed later when using multiple actions files such + So exceptions to any rules you make, should come in the latter part of the file (or + in a file that is processed later when using multiple actions files such as user.action). For multi-valued actions, the actions are applied in the order they are specified. Actions files are processed in the order they are defined in config (the default @@ -3108,7 +3630,7 @@ Multi-value. - + Parameter: @@ -3119,14 +3641,14 @@ - + Notes: - This action may be specified multiple times, in order to define multiple - headers. This is rarely needed for the typical user. If you don't know what - HTTP headers are, you definitely don't need to worry about this + This action may be specified multiple times, in order to define multiple + headers. This is rarely needed for the typical user. If you don't know what + HTTP headers are, you definitely don't need to worry about this one. @@ -3169,10 +3691,10 @@ the handle-as-image, set-image-blocker, and + linkend="set-image-blocker">set-image-blocker, and handle-as-empty-document actions. - + @@ -3191,7 +3713,7 @@ A block reason that should be given to the user. - + Notes: @@ -3202,18 +3724,18 @@ to the blocked content (the latter only if the force feature is available and enabled). - - A very important exception occurs if both + + A very important exception occurs if both block and handle-as-image, - apply to the same request: it will then be replaced by an image. If + apply to the same request: it will then be replaced by an image. If set-image-blocker (see below) also applies, the type of image will be determined by its parameter, if not, the standard checkerboard pattern is sent. - It is important to understand this process, in order - to understand how Privoxy deals with - ads and other unwanted content. Blocking is a core feature, and one + It is important to understand this process, in order + to understand how Privoxy deals with + ads and other unwanted content. Blocking is a core feature, and one upon which various other features depend. @@ -3234,12 +3756,12 @@ # Block and replace with "blocked" page .nasty-stuff.example.com -{+block{Doubleclick banners.} +handle-as-image} +{+block{Doubleclick banners.} +handle-as-image} # Block and replace with image .ad.doubleclick.net .ads.r.us/banners/ -{+block{Layered ads.} +handle-as-empty-document} +{+block{Layered ads.} +handle-as-empty-document} # Block and then ignore adserver.example.net/.*\.js$ @@ -3297,7 +3819,7 @@ - + Notes: @@ -3362,7 +3884,7 @@ - + Notes: @@ -3427,7 +3949,7 @@ Client headers to which this action applies are filtered on-the-fly through the specified regular expression based substitutions, the result is used as - tag. + tag. @@ -3449,7 +3971,7 @@ - + Notes: @@ -3534,11 +4056,11 @@ Parameter: - Any string. - + Any string. + - + Notes: @@ -3547,7 +4069,7 @@ browser to decide what to do with the document. The value of this header can cause the browser to open a download menu instead of displaying the document by itself, even if the document's format is - supported by the browser. + supported by the browser. The declared content type can also affect which rendering mode @@ -3561,13 +4083,13 @@ Content-Type: text/html, you can use &my-app; to overwrite it with application/xml and validate the web master's claim inside your XHTML-supporting browser. - If the syntax is incorrect, the browser will complain loudly. + If the syntax is incorrect, the browser will complain loudly. You can also go the opposite direction: if your browser prints error messages instead of rendering a document falsely declared as XHTML, you can overwrite the content type with - text/html and have it rendered as broken HTML document. + text/html and have it rendered as broken HTML document. By default content-type-overwrite only replaces @@ -3585,7 +4107,7 @@ Of course you can apply content-type-overwrite to a whole site and then make URL based exceptions, but it's a lot - more work to get the same precision. + more work to get the same precision. @@ -3647,10 +4169,10 @@ Any string. - + - + Notes: @@ -3683,7 +4205,7 @@ Example usage (section): - # Block the non-existent "Privacy-Violation:" client header + # Block the non-existent "Privacy-Violation:" client header { +crunch-client-header{Privacy-Violation:} } / @@ -3730,10 +4252,10 @@ N/A - + - + Notes: @@ -3817,7 +4339,7 @@ - + Notes: @@ -3830,7 +4352,7 @@ It makes no sense at all to use this action in conjunction with the session-cookies-only action, - since it would prevent the session cookies from being set. See also + since it would prevent the session cookies from being set. See also filter-content-cookies. @@ -3884,10 +4406,10 @@ Any string. - + - + Notes: @@ -3968,7 +4490,7 @@ - + Notes: @@ -4036,7 +4558,7 @@ - + Notes: @@ -4104,16 +4626,26 @@ - + Notes: This is a left-over from the time when Privoxy didn't support important HTTP/1.1 features well. It is left here for the - unlikely case that you experience HTTP/1.1 related problems with some server - out there. Not all HTTP/1.1 features and requirements are supported yet, - so there is a chance you might need this action. + unlikely case that you experience HTTP/1.1-related problems with some server + out there. + + + Note that enabling this action is only a workaround. It should not + be enabled for sites that work without it. While it shouldn't break + any pages, it has an (usually negative) performance impact. + + + If you come across a site where enabling this action helps, please report it, + so the cause of the problem can be analyzed. If the problem turns out to be + caused by a bug in Privoxy it should be + fixed so the following release works without the work around. @@ -4184,7 +4716,7 @@ Notes: - + Many sites, like yahoo.com, don't just link to other sites. Instead, they will link to some script on their own servers, giving the destination as a parameter, which will then redirect you to the final target. URLs @@ -4202,7 +4734,7 @@ This feature is currently not very smart and is scheduled for improvement. If it is enabled by default, you will have to create some exceptions to - this action. It can lead to failures in several ways: + this action. It can lead to failures in several ways: Not every URLs with other URLs as parameters is evil. @@ -4243,7 +4775,7 @@ { +fast-redirects{simple-check} } - one.example.com + one.example.com { +fast-redirects{check-decoded-url} } another.example.com/testing @@ -4263,7 +4795,7 @@ Typical use: - Get rid of HTML and JavaScript annoyances, banner advertisements (by size), + Get rid of HTML and JavaScript annoyances, banner advertisements (by size), do fun text replacements, add personalized effects, etc. @@ -4288,17 +4820,17 @@ Parameterized. - + Parameter: The name of a content filter, as defined in the filter file. - Filters can be defined in one or more files as defined by the + Filters can be defined in one or more files as defined by the filterfile - option in the config file. - default.filter is the collection of filters - supplied by the developers. Locally defined filters should go + option in the config file. + default.filter is the collection of filters + supplied by the developers. Locally defined filters should go in their own file, such as user.filter. @@ -4307,12 +4839,12 @@ - + Notes: - For your convenience, there are a number of pre-defined filters available + For your convenience, there are a number of pre-defined filters available in the distribution filter file that you can use. See the examples below for a list. @@ -4326,20 +4858,20 @@ Rolling your own - filters requires a knowledge of + filters requires a knowledge of Regular - Expressions and + Expressions and HTML. - This is very powerful feature, and potentially very intrusive. + This is very powerful feature, and potentially very intrusive. Filters should be used with caution, and where an equivalent action is not available. - The amount of data that can be filtered is limited to the + The amount of data that can be filtered is limited to the buffer-limit - option in the main config file. The + option in the main config file. The default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered - data, and all pending data, is passed through unfiltered. + data, and all pending data, is passed through unfiltered. Inappropriate MIME types, such as zipped files, are not filtered at all. @@ -4350,10 +4882,10 @@ by defining appropriate -filter exceptions. - Compressed content can't be filtered either, unless &my-app; - is compiled with zlib support (requires at least &my-app; 3.0.7), - in which case &my-app; will decompress the content before filtering - it. + Compressed content can't be filtered either, but if &my-app; + is compiled with zlib support and a supported compression algorithm + is used (gzip or deflate), &my-app; can first decompress the content + and then filter it. If you use a &my-app; version without zlib support, but want filtering to work on @@ -4362,11 +4894,11 @@ action in conjunction with filter. - Content filtering can achieve some of the same effects as the + Content filtering can achieve some of the same effects as the block - action, i.e. it can be used to block ads and banners. But the mechanism - works quite differently. One effective use, is to block ad banners - based on their size (see below), since many of these seem to be somewhat + action, i.e. it can be used to block ads and banners. But the mechanism + works quite differently. One effective use, is to block ad banners + based on their size (see below), since many of these seem to be somewhat standardized. @@ -4384,7 +4916,7 @@ Example usage (with filters from the distribution default.filter file). - See the Predefined Filters section for + See the Predefined Filters section for more explanation on each: @@ -4516,7 +5048,7 @@ Declares a document as text, even if the Content-Type: isn't detected as such. - + @@ -4548,7 +5080,7 @@ force-text-mode declares a document as text, without looking at the Content-Type: first. - + Think twice before activating this action. Filtering binary data with regular expressions can cause file damage. @@ -4556,7 +5088,7 @@ - + Example usage: @@ -4590,7 +5122,7 @@ Overrules the forward directives in the configuration file. - + @@ -4644,7 +5176,7 @@ file, but without the URL pattern. It can be used as replacement, but normally it's only used in cases where matching based on the request URL isn't sufficient. - + Please read the description for the forward directives before using this action. Forwarding to the wrong people will reduce your privacy and increase the @@ -4662,7 +5194,7 @@ - + Example usage: @@ -4756,7 +5288,7 @@ # Block all documents on example.org that end with ".js", -# but send an empty document instead of the usual HTML message. +# but send an empty document instead of the usual HTML message. {+block{Blocked JavaScript} +handle-as-empty-document} example.org/.*\.js$ @@ -4809,14 +5341,14 @@ - + Notes: The below generic example section is actually part of default.action. It marks all URLs with well-known image file name extensions as images and should - be left intact. + be left intact. Users will probably only want to use the handle-as-image action in conjunction with @@ -4890,10 +5422,10 @@ Keyword: block, or any user defined value. - + - + Notes: @@ -4919,7 +5451,7 @@ to a rare language, you should consider that it helps to make your requests unique and thus easier to trace. If you don't plan to change this header frequently, - you should stick to a common language. + you should stick to a common language. @@ -4976,10 +5508,10 @@ Keyword: block, or any user defined value. - + - + Notes: @@ -5048,7 +5580,7 @@ Effect: - Deletes the If-Modified-Since: HTTP client header or modifies its value. + Deletes the If-Modified-Since: HTTP client header or modifies its value. @@ -5066,10 +5598,10 @@ Keyword: block, or a user defined value that specifies a range of hours. - + - + Notes: @@ -5157,12 +5689,12 @@ - + Notes: - The keyword block will completely remove the header + The keyword block will completely remove the header (not to be confused with the block action). @@ -5243,7 +5775,7 @@ - + Notes: @@ -5272,12 +5804,12 @@ will work with referrer checks, as long as content and valid referring page are on the same host. Most of the time that's the case. - + hide-referer is an alternate spelling of hide-referrer and the two can be can be freely substituted with each other. (referrer is the correct English spelling, however the HTTP specification has a bug - it - requires it to be spelled as referer.) + requires it to be spelled as referer.) @@ -5333,16 +5865,16 @@ - + Notes: - + This can lead to problems on web sites that depend on looking at this header in order to customize their content for different browsers (which, by the way, is NOT the right thing to do: good web sites - work browser-independently). + work browser-independently). @@ -5351,17 +5883,14 @@ not recommended. In single-user, single-browser setups, you might use it to delete your OS version information from the headers, because it is an invitation to exploit known bugs for your - OS. It is also occasionally useful to forge this in order to access - sites that won't let you in otherwise (though there may be a good - reason in some cases). Example of this: some MSN sites will not - let Mozilla enter, yet forging to a - Netscape 6.1 user-agent works just fine. - (Must be just a silly MS goof, I'm sure :-). + OS. It is also occasionally useful to forge this in order to access + sites that won't let you in otherwise (though there may be a good + reason in some cases). - More information on known user-agent strings can be found at + More information on known user-agent strings can be found at http://www.user-agents.org/ - and + and http://en.wikipedia.org/wiki/User_agent. @@ -5417,7 +5946,7 @@ - + Notes: @@ -5500,7 +6029,7 @@ - + Notes: @@ -5520,7 +6049,7 @@ Most text-based instances compress very well, the size is seldom decreased by less than 50%, for markup-heavy instances like news feeds saving more than 90% of the original size isn't - unusual. + unusual. Not using compression will therefore slow down the transfer, and you should only @@ -5585,7 +6114,7 @@ Effect: - Deletes the Last-Modified: HTTP server header or modifies its value. + Deletes the Last-Modified: HTTP server header or modifies its value. @@ -5604,10 +6133,10 @@ One of the keywords: block, reset-to-request-time and randomize - + - + Notes: @@ -5623,7 +6152,7 @@ between the original value and the current time. In theory the server could send each document with a different Last-Modified: header to track visits without using cookies. Randomize - makes it impossible and the browser can still revalidate cached documents. + makes it impossible and the browser can still revalidate cached documents. reset-to-request-time overwrites the value of the @@ -5639,7 +6168,7 @@ of the request, the random range becomes zero and the value stays the same. Therefore you should later randomize it a second time with hided-if-modified-since, - just to be sure. + just to be sure. It is also recommended to use this action together with @@ -5706,7 +6235,7 @@ - + Notes: @@ -5815,7 +6344,7 @@ - + Notes: @@ -5898,7 +6427,7 @@ - + Notes: @@ -5949,7 +6478,7 @@ Allow only temporary session cookies (for the current - browser session only). + browser session only). @@ -5981,12 +6510,12 @@ - + Notes: - This is less strict than crunch-incoming-cookies / + This is less strict than crunch-incoming-cookies / crunch-outgoing-cookies and allows you to browse websites that insist or rely on setting cookies, without compromising your privacy too badly. @@ -5994,7 +6523,7 @@ Most browsers will not permanently store cookies that have been processed by session-cookies-only and will forget about them between sessions. This makes profiling cookies useless, but won't break sites which require cookies so - that you can log in for transactions. This is generally turned on for all + that you can log in for transactions. This is generally turned on for all sites, and is the recommended setting. @@ -6013,9 +6542,9 @@ These would have to be removed manually. - Privoxy also uses - the content-cookies filter - to block some types of cookies. Content cookies are not effected by + Privoxy also uses + the content-cookies filter + to block some types of cookies. Content cookies are not effected by session-cookies-only. @@ -6089,7 +6618,7 @@ target-url to send a redirect to target-url. You can redirect - to any image anywhere, even in your local filesystem via file:/// URL. + to any image anywhere, even in your local filesystem via file:/// URL. (But note that not all browsers support redirecting to a local file system). @@ -6152,8 +6681,8 @@ Summary Note that many of these actions have the potential to cause a page to - misbehave, possibly even not to display at all. There are many ways - a site designer may choose to design his site, and what HTTP header + misbehave, possibly even not to display at all. There are many ways + a site designer may choose to design his site, and what HTTP header content, and other criteria, he may depend on. There is no way to have hard and fast rules for all sites. See the Appendix for a brief example on troubleshooting @@ -6171,7 +6700,7 @@ These can in turn be invoked just like the built-in actions. Currently, an alias name can contain any character except space, tab, =, - { and }, but we strongly + { and }, but we strongly recommend that you only use a to z, 0 to 9, +, and -. Alias names are not case sensitive, and are not required to start with a @@ -6238,7 +6767,7 @@ - ...and put them to use. These sections would appear in the lower part of an + ...and put them to use. These sections would appear in the lower part of an actions file and define exceptions to the default actions (as specified further up for the / pattern): @@ -6256,7 +6785,7 @@ # Shopping sites: # Allow cookies (for setting and retrieving your customer data) - # + # {shop} .quietpc.com .worldpay.com # for quietpc.com @@ -6270,8 +6799,8 @@ - Aliases like shop and fragile are typically used for - problem sites that require more than one action to be disabled + Aliases like shop and fragile are typically used for + problem sites that require more than one action to be disabled in order to function properly. @@ -6316,7 +6845,7 @@ preceding the action name enables the action, a - disables!). Also note how this long line has been made more readable by splitting it into multiple lines with line continuation. - + @@ -6419,13 +6948,13 @@ require cookies to log in, and pop-up windows for shopping carts or item details. Again, we'll use a pre-defined alias: - + # Shopping sites: # { shop } -.quietpc.com +.quietpc.com .worldpay.com # for quietpc.com .jungle.com .scan.co.uk @@ -6494,7 +7023,7 @@ # Known ad generators: # { +block-as-image } -ar.atwola.com +ar.atwola.com .ad.doubleclick.net .ad.*.doubleclick.net .a.yimg.com/(?:(?!/i/).)*$ @@ -6529,7 +7058,7 @@ { +block{Banner ads.} } # Generic patterns: -# +# ad*. .*ads. banner?. @@ -6550,7 +7079,7 @@ But being very generic, they necessarily also catch URLs that we don't want - to block. The pattern .*ads. e.g. catches + to block. The pattern .*ads. e.g. catches nasty-ads.nasty-corp.com as intended, but also downloads.sourcefroge.net or adsl.some-provider.net. So here come some @@ -6577,7 +7106,7 @@ ########################################################################## # By domain: -# +# { -block } adv[io]*. # (for advogato.org and advice.*) adsl. # (has nothing to do with ads) @@ -6627,13 +7156,13 @@ So far we are painting with a broad brush by setting general policies, - which would be a reasonable starting point for many people. Now, + which would be a reasonable starting point for many people. Now, you might want to be more specific and have customized rules that are more suitable to your personal habits and preferences. These would be for narrowly defined situations like your ISP or your bank, and should - be placed in user.action, which is parsed after all other + be placed in user.action, which is parsed after all other actions files and hence has the last word, over-riding any previously - defined actions. user.action is also a + defined actions. user.action is also a safe place for your personal settings, since default.action is actively maintained by the Privoxy developers and you'll probably want @@ -6642,7 +7171,7 @@ So let's look at a few examples of things that one might typically do in - user.action: + user.action: @@ -6665,8 +7194,8 @@ # (Re-)define aliases for this file: # {{alias}} -# -# These aliases just save typing later, and the alias names should +# +# These aliases just save typing later, and the alias names should # be self explanatory. # +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies @@ -6697,7 +7226,7 @@ you don't want to have to log in manually each time. So you'd like to allow persistent cookies for these sites. The allow-all-cookies alias defined above does exactly - that, i.e. it disables crunching of cookies in any direction, and the + that, i.e. it disables crunching of cookies in any direction, and the processing of cookies to make them only temporary. @@ -6742,7 +7271,7 @@ Example of a simple block action. Say you've seen an ad on your favourite page on example.com that you want to get rid of. You have right-clicked the image, selected copy image location - and pasted the URL below while removing the leading http://, into a + and pasted the URL below while removing the leading http://, into a { +block{} } section. Note that { +handle-as-image } need not be specified, since all URLs ending in .gif will be tagged as images by the general rules as set @@ -6760,7 +7289,7 @@ The URLs of dynamically generated banners, especially from large banner farms, often don't use the well-known image file name extensions, which makes it impossible for Privoxy to guess - the file type just by looking at the URL. + the file type just by looking at the URL. You can use the +block-as-image alias defined above for these cases. Note that objects which match this rule but then turn out NOT to be an @@ -6785,7 +7314,7 @@ -- whoa! -- it worked. The fragile aliases disables those actions that are most likely to break a site. Also, good for testing purposes to see if it is Privoxy - that is causing the problem or not. We later find other regular sites + that is causing the problem or not. We later find other regular sites that misbehave, and add those to our personalized list of troublemakers: @@ -6830,19 +7359,19 @@ { allow-ads } .sourceforge.net .slashdot.org - .osdn.net + .osdn.net - Note that allow-ads has been aliased to - -block, - -filter{banners-by-size}, and + Note that allow-ads has been aliased to + -block, + -filter{banners-by-size}, and -filter{banners-by-link} above. Invoke another alias here to force an over-ride of the MIME type - application/x-sh which typically would open a download type + application/x-sh which typically would open a download type dialog. In my case, I want to look at the shell script, and then I can save it should I choose to. @@ -6850,7 +7379,7 @@ { handle-as-text } - /.*\.sh$ + /.*\.sh$ @@ -6885,7 +7414,7 @@ On-the-fly text substitutions need - to be defined in a filter file. Once defined, they + to be defined in a filter file. Once defined, they can then be invoked as an action. @@ -6939,7 +7468,7 @@ Substitutions are made at the source level, so if you want to roll - your own filters, you should first be familiar with HTML syntax, + your own filters, you should first be familiar with HTML syntax, and, of course, regular expressions. @@ -6949,7 +7478,7 @@ here. Each filter consists of a heading line, that starts with one of the keywords FILTER:, CLIENT-HEADER-FILTER: or SERVER-HEADER-FILTER: - followed by the filter's name, and a short (one line) + followed by the filter's name, and a short (one line) description of what it does. Below that line come the jobs, i.e. lines that define the actual text substitutions. By convention, the name of a filter @@ -6964,7 +7493,7 @@ +filter{name} in any actions file. - + Filter definitions start with a header line that contains the filter type, the filter name and the filter description. @@ -6988,13 +7517,13 @@ - If you are new to + If you are new to Regular Expressions, you might want to take a look at the Appendix on regular expressions, and see the Perl manual for - the + the s/// operator's syntax and Perl-style regular expressions in general. @@ -7109,7 +7638,7 @@ Now the pattern is deciphered, but wasn't this about substituting things? So lets look at the substitute: $1"Not Your Business!"$2 is - easy to read: The text remembered as $1, followed by + easy to read: The text remembered as $1, followed by "Not Your Business!" (including the quotation marks!), followed by the text remembered as $2. This produces an exact copy of the original string, with the middle part @@ -7176,7 +7705,7 @@ Note that the i option makes the pattern matching case-insensitive. Also note that ungreedy matching alone doesn't always guarantee a minimal match: In the first parenthesis, we had to use [^>]* - instead of .* to prevent the match from exceeding the + instead of .* to prevent the match from exceeding the <body> tag if it doesn't contain OnUnload, but the page's content does. @@ -7196,7 +7725,7 @@ Note the (?!\.com) part (a so-called negative lookahead) - in the job's pattern, which means: Don't match, if the string + in the job's pattern, which means: Don't match, if the string .com appears directly following microsoft in the page. This prevents links to microsoft.com from being trashed, while still replacing the word everywhere else. @@ -7222,7 +7751,7 @@ The x option in this job turns on extended syntax, and allows for - e.g. the liberal use of (non-interpreted!) whitespace for nicer formatting. + e.g. the liberal use of (non-interpreted!) whitespace for nicer formatting. @@ -7234,11 +7763,11 @@ The Pre-defined Filters - @@ -7278,12 +7807,12 @@ - Use with caution. This is an aggressive filter, and can break sites that + Use with caution. This is an aggressive filter, and can break sites that rely heavily on JavaScript. - + js-events @@ -7307,7 +7836,7 @@ This filter will undo many common instances of HTML based abuse. - The BLINK and MARQUEE tags + The BLINK and MARQUEE tags are neutralized (yeah baby!), and browser windows will be created as resizeable (as of course they should be!), and will have location, scroll and menu bars -- even if specified otherwise. @@ -7328,9 +7857,9 @@ This filter disables most HTML and JavaScript code that reads or sets - cookies. It cannot detect all clever uses of these types of code, so it + cookies. It cannot detect all clever uses of these types of code, so it should not be relied on as an absolute fix. Use it wherever you would also - use the cookie crunch actions. + use the cookie crunch actions. @@ -7339,8 +7868,8 @@ refresh tags - Disable any refresh tags if the interval is greater than nine seconds (so - that redirections done via refresh tags are not destroyed). This is useful + Disable any refresh tags if the interval is greater than nine seconds (so + that redirections done via refresh tags are not destroyed). This is useful for dial-on-demand setups, or for those who find this HTML feature annoying. @@ -7351,9 +7880,9 @@ unsolicited-popups - This filter attempts to prevent only unsolicited pop-up - windows from opening, yet still allow pop-up windows that the user - has explicitly chosen to open. It was added in version 3.0.1, + This filter attempts to prevent only unsolicited pop-up + windows from opening, yet still allow pop-up windows that the user + has explicitly chosen to open. It was added in version 3.0.1, as an improvement over earlier such filters. @@ -7364,7 +7893,7 @@ This is recommended only for browsers that cannot perform this function - reliably themselves. And be aware that some sites require such windows + reliably themselves. And be aware that some sites require such windows in order to function normally. Use with caution. @@ -7397,7 +7926,7 @@ banners-by-size - This filter removes image tags purely based on what size they are. Fortunately + This filter removes image tags purely based on what size they are. Fortunately for us, many ads and banner images tend to conform to certain standardized sizes, which makes this filter quite effective for ad stripping purposes. @@ -7406,7 +7935,7 @@ but just happen to be of one of the standard banner sizes. - Recommended only for those who require extreme ad blocking. The default + Recommended only for those who require extreme ad blocking. The default block rules should catch 95+% of all ads without this filter enabled. @@ -7416,7 +7945,7 @@ banners-by-link - This is an experimental filter that attempts to kill any banners if + This is an experimental filter that attempts to kill any banners if their URLs seem to point to known or suspected click trackers. It is currently not of much value and is not recommended for use by default. @@ -7427,7 +7956,7 @@ webbugs - Webbugs are small, invisible images (technically 1X1 GIF images), that + Webbugs are small, invisible images (technically 1X1 GIF images), that are used to track users across websites, and collect information on them. As an HTML page is loaded by the browser, an embedded image tag causes the browser to contact a third-party site, disclosing the tracking information @@ -7446,7 +7975,7 @@ A rather special-purpose filter that can be used to enlarge textareas (those - multi-line text boxes in web forms) and turn off hard word wrap in them. + multi-line text boxes in web forms) and turn off hard word wrap in them. It was written for the sourceforge.net tracker system where such boxes are a nuisance, but it can be handy on other sites, too. @@ -7490,20 +8019,20 @@ Many Microsoft products that generate HTML use non-standard extensions (read: violations) of the ISO 8859-1 aka Latin-1 character set. This can cause those - HTML documents to display with errors on standard-compliant platforms. + HTML documents to display with errors on standard-compliant platforms. - This filter translates the MS-only characters into Latin-1 equivalents. - It is not necessary when using MS products, and will cause corruption of + This filter translates the MS-only characters into Latin-1 equivalents. + It is not necessary when using MS products, and will cause corruption of all documents that use 8-bit character sets other than Latin-1. It's mostly worthwhile for Europeans on non-MS platforms, if weird garbage characters - sometimes appear on some pages, or user agents that don't correct for this on + sometimes appear on some pages, or user agents that don't correct for this on the fly. +--> @@ -7513,7 +8042,7 @@ A filter for shockwave haters. As the name suggests, this filter strips code - out of web pages that is used to embed shockwave flash objects. + out of web pages that is used to embed shockwave flash objects. @@ -7589,12 +8118,12 @@ - + yahoo - Another CSS based block, this time for Yahoo text ads. And removes + Another CSS based block, this time for Yahoo text ads. And removes a width limitation as well. @@ -7604,7 +8133,7 @@ msn - Another CSS based block, this time for MSN text ads. And removes + Another CSS based block, this time for MSN text ads. And removes tracking URLs, as well as a width limitation. @@ -7633,7 +8162,7 @@ - + html-to-xml @@ -7712,13 +8241,13 @@ Privoxy's Template Files - All Privoxy built-in pages, i.e. error pages such as the + All Privoxy built-in pages, i.e. error pages such as the 404 - No Such Domain error page, the BLOCKED page and all pages of its web-based - user interface, are generated from templates. + user interface, are generated from templates. (Privoxy must be running for the above links to work as intended.) @@ -7735,10 +8264,10 @@ or exports), which Privoxy fills at run time. It is possible to edit the templates with a normal text editor, should you want to customize them. (Not recommended for the casual - user). Should you create your own custom templates, you should use + user). Should you create your own custom templates, you should use the config setting templdir to specify an alternate location, so your templates do not get overwritten - during upgrades. + during upgrades. Note that just like in configuration files, lines starting @@ -7870,7 +8399,7 @@ expressions in its actions files and filter file, through the PCRE and - @@ -7897,7 +8426,7 @@ To make a simple analogy, we do something similar when we use wild-card - characters when listing files with the dir command in DOS. + characters when listing files with the dir command in DOS. *.* matches all filenames. The special character here is the asterisk which matches any and all characters. We can be more specific and use ? to match just individual @@ -7908,7 +8437,7 @@ Regular expressions do essentially the same thing, but are much, much more - powerful. There are many more special characters and ways of + powerful. There are many more special characters and ways of building complex patterns however. Let's look at a few of the common ones, and then some examples: @@ -7944,10 +8473,10 @@ \ - The escape character denotes that - the following character should be taken literally. This is used where one of the + the following character should be taken literally. This is used where one of the special characters (e.g. .) needs to be taken literally and - not as a special meta-character. Example: example\.com, makes - sure the period is recognized only as a period (and not expanded to its + not as a special meta-character. Example: example\.com, makes + sure the period is recognized only as a period (and not expanded to its meta-character meaning of any single character). @@ -7956,7 +8485,7 @@ [ ] - Characters enclosed in brackets will be matched if any of the enclosed characters are encountered. For instance, [0-9] - matches any numeric digit (zero through nine). As an example, we can combine + matches any numeric digit (zero through nine). As an example, we can combine this with + to match any digit one of more times: [0-9]+. @@ -7973,14 +8502,14 @@ | - The bar character works like an or conditional statement. A match is successful if the sub-expression on either side of | matches. As an example: - /(this|that) example/ uses grouping and the bar character + /(this|that) example/ uses grouping and the bar character and would match either this example or that example, and nothing else. - These are just some of the ones you are likely to use when matching URLs with + These are just some of the ones you are likely to use when matching URLs with Privoxy, and is a long way from a definitive list. This is enough to get us started with a few simple examples which may be more illuminating: @@ -7988,12 +8517,12 @@ /.*/banners/.* - A simple example - that uses the common combination of . and * to + that uses the common combination of . and * to denote any character, zero or more times. In other words, any string at all. - So we start with a literal forward slash, then our regular expression pattern + So we start with a literal forward slash, then our regular expression pattern (.*) another literal forward slash, the string banners, another forward slash, and lastly another - .*. We are building + .*. We are building a directory path here. This will match any file with the path that has a directory named banners in it. The .* matches any characters, and this could conceivably be more forward slashes, so it @@ -8009,14 +8538,14 @@ - /.*/adv((er)?ts?|ertis(ing|ements?))?/ - + /.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have several literal forward slashes again (/), so we are - building another expression that is a file path statement. We have another + building another expression that is a file path statement. We have another .*, so we are matching against any conceivable sub-path, just so it matches our expression. The only true literal that must match our pattern is adv, together with the forward slashes. What comes after the adv string is the - interesting part. + interesting part. @@ -8026,29 +8555,29 @@ ((er)?ts?|ertis(ing|ements?)) is optional, as are the individual sub-expressions: (er), (ing|ements?), and the s. The | - means or. We have two of those. For instance, - (ing|ements?), can expand to match either ing + means or. We have two of those. For instance, + (ing|ements?), can expand to match either ing OR ements?. What is being done here, is an - attempt at matching as many variations of advertisement, and + attempt at matching as many variations of advertisement, and similar, as possible. So this would expand to match just adv, or advert, or adverts, or advertising, or advertisement, or - advertisements. You get the idea. But it would not match + advertisements. You get the idea. But it would not match advertizements (with a z). We could fix that by - changing our regular expression to: + changing our regular expression to: /.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/, which would then match either spelling. - /.*/advert[0-9]+\.(gif|jpe?g) - Again - another path statement with forward slashes. Anything in the square brackets + /.*/advert[0-9]+\.(gif|jpe?g) - Again + another path statement with forward slashes. Anything in the square brackets [ ] can be matched. This is using 0-9 as a shorthand expression to mean any digit one through nine. It is the same as saying 0123456789. So any digit matches. The + - means one or more of the preceding expression must be included. The preceding - expression here is what is in the square brackets -- in this case, any digit - one through nine. Then, at the end, we have a grouping: (gif|jpe?g). + means one or more of the preceding expression must be included. The preceding + expression here is what is in the square brackets -- in this case, any digit + one through nine. Then, at the end, we have a grouping: (gif|jpe?g). This includes a |, so this needs to match the expression on either side of that bar character also. A simple gif on one side, and the other side will in turn match either jpeg or jpg, @@ -8078,7 +8607,7 @@ - More reading on Perl Compatible Regular expressions: + More reading on Perl Compatible Regular expressions: http://perldoc.perl.org/perlre.html @@ -8097,22 +8626,22 @@ Privoxy's Internal Pages - Since Privoxy proxies each requested - web page, it is easy for Privoxy to + Since Privoxy proxies each requested + web page, it is easy for Privoxy to trap certain special URLs. In this way, we can talk directly to - Privoxy, and see how it is - configured, see how our rules are being applied, change these + Privoxy, and see how it is + configured, see how our rules are being applied, change these rules and other configuration options, and even turn - Privoxy's filtering off, all with + Privoxy's filtering off, all with a web browser. - The URLs listed below are the special ones that allow direct access + The URLs listed below are the special ones that allow direct access to Privoxy. Of course, - Privoxy must be running to access these. If - not, you will get a friendly error message. Internet access is not + Privoxy must be running to access these. If + not, you will get a friendly error message. Internet access is not necessary either. @@ -8120,11 +8649,11 @@ - - Privoxy main page: + + Privoxy main page:
- + http://config.privoxy.org/
@@ -8136,77 +8665,77 @@
- - Show information about the current configuration, including viewing and + + Show information about the current configuration, including viewing and editing of actions files:
- + http://config.privoxy.org/show-status
- + - + Show the source code version numbers:
- + http://config.privoxy.org/show-version
- + - + Show the browser's request headers:
- + http://config.privoxy.org/show-request
- + - + Show which actions apply to a URL and why:
- + http://config.privoxy.org/show-url-info
- + - - Toggle Privoxy on or off. This feature can be turned off/on in the main + + Toggle Privoxy on or off. This feature can be turned off/on in the main config file. When toggled off, Privoxy continues to run, but only as a pass-through proxy, with no actions taking place:
- + http://config.privoxy.org/toggle
- Short cuts. Turn off, then on: + Short cuts. Turn off, then on:
- + http://config.privoxy.org/toggle?set=disable
- + http://config.privoxy.org/toggle?set=enable
- +
@@ -8231,7 +8760,7 @@ the bookmark may not be safe - just click OK. Then you can run the Bookmarklet directly from your favorites/bookmarks. For even faster access, you can put them on the Links bar (IE) or the Personal - Toolbar (Netscape), and run them with a single click. + Toolbar (Netscape), and run them with a single click. @@ -8242,47 +8771,47 @@ Privoxy - Enable -
+
Privoxy - Disable - + Privoxy - Toggle Privoxy (Toggles between enabled and disabled) - + Privoxy- View Status - + + + --> Privoxy - Why? - + Credit: The site which gave us the general idea for these bookmarklets is www.bookmarklets.com. They - have more information about bookmarklets. + have more information about bookmarklets. @@ -8295,7 +8824,7 @@ Chain of Events - Let's take a quick look at how some of Privoxy's + Let's take a quick look at how some of Privoxy's core features are triggered, and the ensuing sequence of events when a web page is requested by your browser: @@ -8304,48 +8833,48 @@ - First, your web browser requests a web page. The browser knows to send - the request to Privoxy, which will in turn, - relay the request to the remote web server after passing the following - tests: + First, your web browser requests a web page. The browser knows to send + the request to Privoxy, which will in turn, + relay the request to the remote web server after passing the following + tests: - + - Privoxy traps any request for its own internal CGI + Privoxy traps any request for its own internal CGI pages (e.g http://p.p/) and sends the CGI page back to the browser. - + - Next, Privoxy checks to see if the URL + Next, Privoxy checks to see if the URL matches any +block patterns. If so, the URL is then blocked, and the remote web server will not be contacted. - +handle-as-image - and + +handle-as-image + and +handle-as-empty-document - are then checked, and if there is no match, an + are then checked, and if there is no match, an HTML BLOCKED page is sent back to the browser. Otherwise, if it does match, an image is returned for the former, and an empty text document for the latter. The type of image would depend on the setting of +set-image-blocker (blank, checkerboard pattern, or an HTTP redirect to an image elsewhere). - + Untrusted URLs are blocked. If URLs are being added to the trust file, then that is done. - + If the URL pattern matches the +fast-redirects action, it is then processed. Unwanted parts of the requested URL are stripped. - + Now the rest of the client browser's request headers are processed. If any @@ -8354,24 +8883,24 @@ etc.), headers are suppressed or forged as determined by these actions and their parameters. - + Now the web server starts sending its response back (i.e. typically a web page). - + First, the server headers are read and processed to determine, among other things, the MIME type (document type) and encoding. The headers are then - filtered as determined by the + filtered as determined by the +crunch-incoming-cookies, +session-cookies-only, and +downgrade-http-version actions. - + If any +filter action @@ -8384,35 +8913,35 @@ they are specified in one of the filter files. Animated GIFs, if present, are reduced to either the first or last frame, depending on the action setting.The entire page, which is now filtered, is then sent by - Privoxy back to your browser. + Privoxy back to your browser. If neither a +filter action or +deanimate-gifs - matches, then Privoxy passes the raw data through + matches, then Privoxy passes the raw data through to the client browser as it becomes available. - + - As the browser receives the now (possibly filtered) page content, it + As the browser receives the now (possibly filtered) page content, it reads and then requests any URLs that may be embedded within the page source, e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g. frames), sounds, etc. For each of these objects, the browser issues a separate request (this is easily viewable in Privoxy's logs). And each such request is in turn processed just as above. Note that a - complex web page will have many, many such embedded URLs. If these - secondary requests are to a different server, then quite possibly a very + complex web page will have many, many such embedded URLs. If these + secondary requests are to a different server, then quite possibly a very differing set of actions is triggered. - - + + NOTE: This is somewhat of a simplistic overview of what happens with each URL - request. For the sake of brevity and simplicity, we have focused on + request. For the sake of brevity and simplicity, we have focused on Privoxy's core features only. @@ -8424,7 +8953,7 @@ Troubleshooting: Anatomy of an Action - The way Privoxy applies + The way Privoxy applies actions and filters to any given URL can be complex, and not always so easy to understand what is happening. And sometimes we need to be able to @@ -8433,16 +8962,16 @@ is causing us a problem inadvertently. It can be a little daunting to look at the actions and filters files themselves, since they tend to be filled with regular expressions whose consequences are not - always so obvious. + always so obvious. - One quick test to see if Privoxy is causing a problem - or not, is to disable it temporarily. This should be the first troubleshooting - step. See the Bookmarklets section on a quick - and easy way to do this (be sure to flush caches afterward!). Looking at the - logs is a good idea too. (Note that both the toggle feature and logging are - enabled via config file settings, and may need to be + One quick test to see if Privoxy is causing a problem + or not, is to disable it temporarily. This should be the first troubleshooting + step. See the Bookmarklets section on a quick + and easy way to do this (be sure to flush caches afterward!). Looking at the + logs is a good idea too. (Note that both the toggle feature and logging are + enabled via config file settings, and may need to be turned on.) @@ -8454,7 +8983,7 @@ - Privoxy also provides the + Privoxy also provides the http://config.privoxy.org/show-url-info page that can show us very specifically how actions are being applied to any given URL. This is a big help for troubleshooting. @@ -8462,7 +8991,7 @@ First, enter one URL (or partial URL) at the prompt, and then - Privoxy will tell us + Privoxy will tell us how the current configuration will handle it. This will not help with filtering effects (i.e. the +filter action) from @@ -8478,8 +9007,8 @@ - Let's try an example, google.com, - and look at it one section at a time in a sample configuration (your real + Let's try an example, google.com, + and look at it one section at a time in a sample configuration (your real configuration may vary): @@ -8503,7 +9032,7 @@ +session-cookies-only +set-image-blocker {pattern} / - + { -session-cookies-only } .google.com @@ -8511,17 +9040,17 @@ .google.com In file: user.action [ View ] [ Edit ] -(no matches in this file) +(no matches in this file) - This is telling us how we have defined our + This is telling us how we have defined our actions, and - which ones match for our test case, google.com. + which ones match for our test case, google.com. Displayed is all the actions that are available to us. Remember, the + sign denotes on. - - denotes off. So some are on here, but many + denotes off. So some are on here, but many are off. Each example we try may provide a slightly different end result, depending on our configuration directives. @@ -8549,7 +9078,7 @@ action, allowing this to take place unmolested. Note that there is a leading dot here -- .google.com. This will match any hosts and sub-domains, in the google.com domain also, such as - www.google.com or mail.google.com. But it would not + www.google.com or mail.google.com. But it would not match www.google.de! So, apparently, we have these two actions defined as exceptions to the general rules at the top somewhere in the lower part of our default.action file, and @@ -8559,7 +9088,7 @@ Then, for our user.action file, we again have no hits. So there is nothing google-specific that we might have added to our own, local - configuration. If there was, those actions would over-rule any actions from + configuration. If there was, those actions would over-rule any actions from previously processed files, such as default.action. user.action typically has the last word. This is the best place to put hard and fast exceptions, @@ -8567,7 +9096,7 @@ And finally we pull it all together in the bottom section and summarize how - Privoxy is applying all its actions + Privoxy is applying all its actions to google.com: @@ -8576,10 +9105,10 @@ Final results: - + -add-header -block - +change-x-forwarded-for{block} + +change-x-forwarded-for{block} -client-header-filter{hide-tor-exit-notation} -content-type-overwrite -crunch-client-header @@ -8630,15 +9159,15 @@ -prevent-compression -redirect -server-header-filter{xml-to-html} - -server-header-filter{html-to-xml} + -server-header-filter{html-to-xml} -session-cookies-only +set-image-blocker {pattern} - Notice the only difference here to the previous listing, is to + Notice the only difference here to the previous listing, is to fast-redirects and session-cookies-only, - which are activated specifically for this site in our configuration, + which are activated specifically for this site in our configuration, and thus show in the Final Results. @@ -8661,25 +9190,25 @@ - We'll just show the interesting part here - the explicit matches. It is - matched three different times. Two +block{} sections, + We'll just show the interesting part here - the explicit matches. It is + matched three different times. Two +block{} sections, and a +block{} +handle-as-image, - which is the expanded form of one of our aliases that had been defined as: + which is the expanded form of one of our aliases that had been defined as: +block-as-image. (Aliases are defined in - the first section of the actions file and typically used to combine more + the first section of the actions file and typically used to combine more than one action.) - Any one of these would have done the trick and blocked this as an unwanted - image. This is unnecessarily redundant since the last case effectively - would also cover the first. No point in taking chances with these guys - though ;-) Note that if you want an ad or obnoxious + Any one of these would have done the trick and blocked this as an unwanted + image. This is unnecessarily redundant since the last case effectively + would also cover the first. No point in taking chances with these guys + though ;-) Note that if you want an ad or obnoxious URL to be invisible, it should be defined as ad.doubleclick.net is done here -- as both a +block{} - and an + and an +handle-as-image. The custom alias +block-as-image just simplifies the process and make it more readable. @@ -8697,9 +9226,9 @@ In file: default.action [ View ] [ Edit ] - {-add-header + {-add-header -block - +change-x-forwarded-for{block} + +change-x-forwarded-for{block} -client-header-filter{hide-tor-exit-notation} -content-type-overwrite -crunch-client-header @@ -8707,8 +9236,8 @@ -crunch-incoming-cookies -crunch-outgoing-cookies -crunch-server-header - +deanimate-gifs - -downgrade-http-version + +deanimate-gifs + -downgrade-http-version +fast-redirects {check-decoded-url} -filter {js-events} -filter {content-cookies} @@ -8738,18 +9267,18 @@ -filter {no-ping} -force-text-mode -handle-as-empty-document - -handle-as-image + -handle-as-image -hide-accept-language - -hide-content-disposition - +hide-from-header{block} - +hide-referer{forge} - -hide-user-agent + -hide-content-disposition + +hide-from-header{block} + +hide-referer{forge} + -hide-user-agent -overwrite-last-modified - +prevent-compression + +prevent-compression -redirect -server-header-filter{xml-to-html} - -server-header-filter{html-to-xml} - +session-cookies-only + -server-header-filter{html-to-xml} + +session-cookies-only +set-image-blocker{blank} } / @@ -8759,10 +9288,10 @@ - Ooops, the /adsl/ is matching /ads in our + Ooops, the /adsl/ is matching /ads in our configuration! But we did not want this at all! Now we see why we get the - blank page. It is actually triggering two different actions here, and - the effects are aggregated so that the URL is blocked, and &my-app; is told + blank page. It is actually triggering two different actions here, and + the effects are aggregated so that the URL is blocked, and &my-app; is told to treat the block as if it were an image. But this is, of course, all wrong. We could now add a new action below this (or better in our own user.action file) that explicitly @@ -8781,14 +9310,14 @@ - Now the page displays ;-) + Now the page displays ;-) Remember to flush your browser's caches when making these kinds of changes to your configuration to insure that you get a freshly delivered page! Or, try using Shift+Reload. - But now what about a situation where we get no explicit matches like + But now what about a situation where we get no explicit matches like we did with: @@ -8802,7 +9331,7 @@ That actually was very helpful and pointed us quickly to where the problem - was. If you don't get this kind of match, then it means one of the default + was. If you don't get this kind of match, then it means one of the default rules in the first section of default.action is causing the problem. This would require some guesswork, and maybe a little trial and error to isolate the offending rule. One likely cause would be one of the @@ -8825,7 +9354,7 @@ - { shop } is an alias that expands to + { shop } is an alias that expands to { -filter -session-cookies-only }. Or you could do your own exception to negate filtering: @@ -8846,23 +9375,23 @@ This would turn off all filtering for these sites. This is best put in user.action, for local site exceptions. Note that when a simple domain pattern is used by itself (without - the subsequent path portion), all sub-pages within that domain are included + the subsequent path portion), all sub-pages within that domain are included automatically in the scope of the action. - Images that are inexplicably being blocked, may well be hitting the + Images that are inexplicably being blocked, may well be hitting the +filter{banners-by-size} - rule, which assumes - that images of certain sizes are ad banners (works well + rule, which assumes + that images of certain sizes are ad banners (works well most of the time since these tend to be standardized). { fragile } is an alias that disables most actions that are the most likely to cause trouble. This can be used as a - last resort for problem sites. - + last resort for problem sites. + @@ -8871,16 +9400,16 @@ mail.google. mybank.example.com - + - Remember to flush caches! Note that the - mail.google reference lacks the TLD portion (e.g. - .com). This will effectively match any TLD with - google in it, such as mail.google.de., + Remember to flush caches! Note that the + mail.google reference lacks the TLD portion (e.g. + .com). This will effectively match any TLD with + google in it, such as mail.google.de., just as an example. - + If this still does not work, you will have to go through the remaining actions one by one to find which one(s) is causing the problem. @@ -8891,7 +9420,7 @@ + + + +

SYNOPSIS

+
+       privoxy   [--help   ]  [--version   ]  [--no-daemon  ] [--pidfile pidfile ]
+       [--user user[.group] ] [--chroot    ]  [--pre-chroot-nslookup  hostname  ]
+       [configfile ]
+
+
+
+
+ +

OPTIONS

+
+       Privoxy may be invoked with the following command line options:
+
+       --help Print brief usage  info and exit.
+
+       --version
+          Print version info and exit.
+
+       --no-daemon
+          Don't   become   a  daemon,  i.e.  don't fork and become process
+          group leader, don't detach from controlling tty, and do all log-
+          ging there.
+
+       --pidfile pidfile
+          On startup, write the process ID to pidfile.  Delete the pidfile
+          on exit.  Failure to create or delete the pidfile  is  non-fatal.
+          If no --pidfile option is  given, no PID file will be used.
+
+       --user user[.group]
+          After  (optionally)  writing the PID file, assume the user ID of
+          user and the GID of group, or, if   the  optional  group  was  not
+          given, the default group of user.  Exit if the privileges are not
+          sufficient to do so.
+
+       --chroot
+          Before changing to the user  ID  given  in  the  --user  option,
+          chroot  to that user's home directory, i.e. make the kernel pre-
+          tend to the Privoxy  process  that  the  directory  tree   starts
+          there.  If set up carefully, this can limit the impact of possi-
+          ble vulnerabilities in Privoxy to  the files  contained  in  that
+          hierarchy.
+
+       --pre-chroot-nslookup hostname
+          Initialize   the   resolver   library   using   hostname   before
+          chroot'ing. On some systems this reduces  the  number  of  files
+          that must be copied into the chroot tree.
+
+       If  the  configfile  is   not  specified on  the  command  line, Privoxy
+       will  look for a file named config in the current directory. If no con-
+       figfile is found, Privoxy will fail to start.
+
+
+
+ +

DESCRIPTION

+
+       Privoxy is a non-caching web proxy with advanced filtering capabilities
+       for enhancing privacy, modifying web page data and HTTP  headers,  con-
+       trolling  access,  and  removing ads and other obnoxious Internet junk.
+       Privoxy has a flexible configuration and  can  be  customized  to  suit
+
+
+
+ +

INSTALLATION AND USAGE

+
+       Browsers can either be individually configured to use Privoxy as  a HTTP
+       proxy (recommended), or Privoxy can be combined with a packet filter to
+       build  an intercepting proxy (see config).  The default setting is  for
+       localhost,  on port  8118 (configurable in the main config  file).   To
+       set  the  HTTP  proxy  in Firefox, go through: Tools; Options; General;
+       Connection Settings; Manual Proxy Configuration.
+
+       For Internet Explorer, go through: Tools; Internet Properties;  Connec-
+       tions; LAN Settings.
+
+       The Secure (SSL) Proxy should also be set to the same values, otherwise
+       https: URLs will not be proxied. Note: Privoxy can only proxy HTTP  and
+       HTTPS  traffic.  Do  not  try  it  with  FTP or other protocols.  HTTPS
+       presents some limitations, and not all features will  work  with  HTTPS
+       connections.
+
+       For other browsers, check the documentation.
+
+
+
+ +

CONFIGURATION

+
+       Privoxy   can  be  configured  with the various configuration files. The
+       default configuration files are: config,  default.filter,  default.action
+       and  default.action.  user.action  should  be  used for locally defined
+       exceptions to the default rules in match-all.action and default.action,
+       and  user.filter  for locally defined filters. These are well commented.
+       On Unix and Unix-like systems, these are located  in  /etc/privoxy/  by
+       default.
+
+       Privoxy   uses  the  concept  of actions in order  to manipulate the data
+       stream between the browser and remote sites.  There are various actions
+       available  with  specific  functions  for  such  things as blocking web
+       sites, managing cookies, etc. These actions can be invoked individually
+       or  combined,  and used against individual URLs, or groups of URLs that
+       can be defined using wildcards and regular expressions. The  result  is
+       that the user has greatly enhanced control and freedom.
+
+       The  actions list (ad blocks, etc) can also be configured with your web
+       browser  at  http://config.privoxy.org/  (assuming  the   configuration
+       allows it).  Privoxy's configuration parameters   can also  be viewed at
+       the same page. In addition, Privoxy can be toggled on/off.  This  is  an
+       internal page, and does not require Internet access.
+
+       See the User Manual for a detailed explanation of installation, general
+       usage, all configuration options, new features and notes on  upgrading.
+
+
+
+ +

FILES

+
+    /usr/sbin/privoxy
+    /etc/privoxy/config
+    /etc/privoxy/match-all.action
+    /etc/privoxy/default.action
+    /etc/privoxy/user.action
+    /etc/privoxy/default.filter
+       detect them automatically.
+
+
+
+ +

NOTES

+
+       This  is  a  UNRELEASED  version  of Privoxy. Not all features are well
+       tested.
+
+       Please see the User Manual on how to contact the   developers,  for  fea-
+       ture requests, reporting problems, and other questions.
+
+
+
+ +

SEE ALSO

+
+       Other references and sites of interest to Privoxy users:
+
+
+       http://www.privoxy.org/, the Privoxy Home page.
+
+       http://www.privoxy.org/faq/, the Privoxy  FAQ.
+
+       http://www.privoxy.org/developer-manual/, the Privoxy developer manual.
+
+       https://sourceforge.net/projects/ijbswa/, the Project Page for  Privoxy
+       on SourceForge.
+
+       http://config.privoxy.org/,  the web-based user interface. Privoxy must
+       be running for this to work. Shortcut: http://p.p/
+
+       https://sourceforge.net/tracker/?group_id=11118&atid=460288, to  submit
+       ``misses''  and other configuration related suggestions to the develop-
+       ers.
+
+
+
+ +

DEVELOPMENT TEAM

+
+    Fabian Keil, lead developer
+    David Schmidt, developer
+
+    Hal Burgiss
+    Lee Rian
+    Roland Rosenfeld
+
+
+
+ +

COPYRIGHT AND LICENSE

+
+   COPYRIGHT
+       Copyright  (C)  2001-2011  by   Privoxy   Developers   <ijbswa-develop-
+       ers@lists.sourceforge.net>
+
+       Some  source  code  is  based  on  code Copyright (C) 1997 by Anonymous
+       Coders and Junkbusters, Inc. and licensed under the GNU General    Public
+       License.
+
+   LICENSE
+       Privoxy   is  free  software;  you  can redistribute it and/or modify it
+       under the terms of the GNU General Public License, version 2,  as  pub-
+       lished by the Free Software Foundation.
+
+ + diff -Nru privoxy-3.0.17/doc/webserver/privoxy-index.html privoxy-3.0.19/doc/webserver/privoxy-index.html --- privoxy-3.0.17/doc/webserver/privoxy-index.html 2010-11-10 21:51:17.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/privoxy-index.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,303 +1,185 @@ - -Privoxy - The Privacy Enhancing Proxy - -

Privoxy - The Privacy Enhancing Proxy

Project Index Page v3.0.17

Privoxy is a non-caching web proxy with advanced filtering capabilities - for enhancing privacy, modifying web page data and HTTP headers, controlling - access, and removing ads and other obnoxious Internet junk. Privoxy has a - flexible configuration and can be customized to suit individual needs and tastes. - It has application for both stand-alone systems and multi-user networks.

Privoxy is Free Software and licensed under the GNU GPLv2.

Privoxy is an associated project of Software in the Public Interest (SPI).

Helping hands and donations are welcome: -



Copyright © 2001-2010 by Privoxy Developers -

\ No newline at end of file + + + + + + + Privoxy - The Privacy Enhancing Proxy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Privoxy - The Privacy + Enhancing Proxy

+ +

Project Index Page v3.0.19

+ +
+ + +

Privoxy is a non-caching web proxy with advanced filtering + capabilities for enhancing privacy, modifying web page data and HTTP + headers, controlling access, and removing ads and other obnoxious + Internet junk. Privoxy has a flexible configuration and can be + customized to suit individual needs and tastes. It has application + for both stand-alone systems and multi-user networks.

+ +

Privoxy is Free Software and licensed under the GNU GPLv2.

+ +

Privoxy is an associated project of Software in the Public + Interest (SPI).

+ +

Helping hands and donations are welcome:

+ + +
+
+
+ + + + + + + +
+
+ +

+ +

Copyright © 2001-2010 by Privoxy Developers

+
+
+ + diff -Nru privoxy-3.0.17/doc/webserver/team/index.html privoxy-3.0.19/doc/webserver/team/index.html --- privoxy-3.0.17/doc/webserver/team/index.html 2006-12-31 20:06:29.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/team/index.html 2011-11-13 17:04:52.000000000 +0000 @@ -1,26 +1,52 @@ + + - - + + + + Privoxy - Team Photos - - -

Privoxy - Team Photos

+ + + + +

Privoxy - Team Photos


+

In our day jobs, we're all models ;-)

+ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +
- + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/actions-file.html privoxy-3.0.19/doc/webserver/user-manual/actions-file.html --- privoxy-3.0.17/doc/webserver/user-manual/actions-file.html 2010-11-10 21:49:47.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/actions-file.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,2293 +1,1301 @@ - -Actions Files - -
Privoxy 3.0.17 User Manual
PrevNext

8. Actions Files

The actions files are used to define what actions - Privoxy takes for which URLs, and thus determines - how ad images, cookies and various other aspects of HTTP content and - transactions are handled, and on which sites (or even parts thereof). - There are a number of such actions, with a wide range of functionality. - Each action does something a little different. - These actions give us a veritable arsenal of tools with which to exert - our control, preferences and independence. Actions can be combined so that - their effects are aggregated when applied against a given set of URLs.

There - are three action files included with Privoxy with - differing purposes:

  • match-all.action - is used to define which - "actions" relating to banner-blocking, images, pop-ups, - content modification, cookie handling etc should be applied by default. - It should be the first actions file loaded -

  • default.action - defines many exceptions (both - positive and negative) from the default set of actions that's configured - in match-all.action. It is a set of rules that should - work reasonably well as-is for most users. This file is only supposed to - be edited by the developers. It should be the second actions file loaded. -

  • user.action - is intended to be for local site - preferences and exceptions. As an example, if your ISP or your bank - has specific requirements, and need special handling, this kind of - thing should go here. This file will not be upgraded. -

  • Edit Set to Cautious Set to Medium Set to Advanced -

    These have increasing levels of aggressiveness and have no - influence on your browsing unless you select them explicitly in the - editor. A default installation should be pre-set to - Cautious. New users should try this for a while before - adjusting the settings to more aggressive levels. The more aggressive - the settings, then the more likelihood there is of problems such as sites - not working as they should. -

    The Edit button allows you to turn each - action on/off individually for fine-tuning. The Cautious - button changes the actions list to low/safe settings which will activate - ad blocking and a minimal set of Privoxy's features, and subsequently - there will be less of a chance for accidental problems. The - Medium button sets the list to a medium level of - other features and a low level set of privacy features. The - Advanced button sets the list to a high level of - ad blocking and medium level of privacy. See the chart below. The latter - three buttons over-ride any changes via with the - Edit button. More fine-tuning can be done in the - lower sections of this internal page. -

    While the actions file editor allows to enable these settings in all - actions files, they are only supposed to be enabled in the first one - to make sure you don't unintentionally overrule earlier rules. -

    The default profiles, and their associated actions, as pre-defined in - default.action are: -

    Table 1. Default Configurations

    FeatureCautiousMediumAdvanced
    Ad-blocking Aggressivenessmediumhighhigh
    Ad-filtering by sizenoyesyes
    Ad-filtering by linknonoyes
    Pop-up killingblocks onlyblocks onlyblocks only
    Privacy Featureslowmediummedium/high
    Cookie handlingnonesession-onlykill
    Referer forgingnoyesyes
    GIF de-animationnoyesyes
    Fast redirectsnonoyes
    HTML tamingnonoyes
    JavaScript tamingnonoyes
    Web-bug killingnoyesyes
    Image tag reorderingnoyesyes
    -

The list of actions files to be used are defined in the main configuration - file, and are processed in the order they are defined (e.g. - default.action is typically processed before - user.action). The content of these can all be viewed and - edited from http://config.privoxy.org/show-status. - The over-riding principle when applying actions, is that the last action that - matches a given URL wins. The broadest, most general rules go first - (defined in default.action), - followed by any exceptions (typically also in - default.action), which are then followed lastly by any - local preferences (typically in user.action). - Generally, user.action has the last word. -

An actions file typically has multiple sections. If you want to use - "aliases" in an actions file, you have to place the (optional) - alias section at the top of that file. - Then comes the default set of rules which will apply universally to all - sites and pages (be very careful with using such a - universal set in user.action or any other actions file after - default.action, because it will override the result - from consulting any previous file). And then below that, - exceptions to the defined universal policies. You can regard - user.action as an appendix to default.action, - with the advantage that it is a separate file, which makes preserving your - personal settings across Privoxy upgrades easier.

- Actions can be used to block anything you want, including ads, banners, or - just some obnoxious URL whose content you would rather not see. Cookies can be accepted - or rejected, or accepted only during the current browser session (i.e. not - written to disk), content can be modified, some JavaScripts tamed, user-tracking - fooled, and much more. See below for a complete list - of actions.

8.1. Finding the Right Mix

Note that some actions, like cookie suppression - or script disabling, may render some sites unusable that rely on these - techniques to work properly. Finding the right mix of actions is not always easy and - certainly a matter of personal taste. And, things can always change, requiring - refinements in the configuration. In general, it can be said that the more - "aggressive" your default settings (in the top section of the - actions file) are, the more exceptions for "trusted" sites you - will have to make later. If, for example, you want to crunch all cookies per - default, you'll have to make exceptions from that rule for sites that you - regularly use and that require cookies for actually useful purposes, like maybe - your bank, favorite shop, or newspaper.

We have tried to provide you with reasonable rules to start from in the - distribution actions files. But there is no general rule of thumb on these - things. There just are too many variables, and sites are constantly changing. - Sooner or later you will want to change the rules (and read this chapter again :).

8.2. How to Edit

The easiest way to edit the actions files is with a browser by - using our browser-based editor, which can be reached from http://config.privoxy.org/show-status. - Note: the config file option enable-edit-actions must be enabled for - this to work. The editor allows both fine-grained control over every single - feature on a per-URL basis, and easy choosing from wholesale sets of defaults - like "Cautious", "Medium" or - "Advanced". Warning: the "Advanced" setting is more - aggressive, and will be more likely to cause problems for some sites. - Experienced users only! -

If you prefer plain text editing to GUIs, you can of course also directly edit the - the actions files with your favorite text editor. Look at - default.action which is richly commented with many - good examples.

8.3. How Actions are Applied to Requests

Actions files are divided into sections. There are special sections, - like the "alias" sections which will - be discussed later. For now let's concentrate on regular sections: They have a - heading line (often split up to multiple lines for readability) which consist - of a list of actions, separated by whitespace and enclosed in curly braces. - Below that, there is a list of URL and tag patterns, each on a separate line.

To determine which actions apply to a request, the URL of the request is - compared to all URL patterns in each "action file". - Every time it matches, the list of applicable actions for the request is - incrementally updated, using the heading of the section in which the - pattern is located. The same is done again for tags and tag patterns later on.

If multiple applying sections set the same action differently, - the last match wins. If not, the effects are aggregated. - E.g. a URL might match a regular section with a heading line of { - +handle-as-image }, - then later another one with just { - +block }, resulting - in both actions to apply. And there may well be - cases where you will want to combine actions together. Such a section then - might look like:

  { +handle-as-image  +block{Banner ads.} }
+
+
+
+
+  
+
+  Actions Files
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

8. Actions + Files

+ +

The actions files are used to define what actions Privoxy takes for which URLs, and thus determines + how ad images, cookies and various other aspects of HTTP content and + transactions are handled, and on which sites (or even parts thereof). + There are a number of such actions, with a wide range of functionality. + Each action does something a little different. These actions give us a + veritable arsenal of tools with which to exert our control, preferences + and independence. Actions can be combined so that their effects are + aggregated when applied against a given set of URLs.

+ +

There are three action files included with Privoxy with differing purposes:

+ +
    +
  • +

    match-all.action - is used to define + which "actions" relating to + banner-blocking, images, pop-ups, content modification, cookie + handling etc should be applied by default. It should be the first + actions file loaded

    +
  • + +
  • +

    default.action - defines many exceptions + (both positive and negative) from the default set of actions that's + configured in match-all.action. It is a set + of rules that should work reasonably well as-is for most users. This + file is only supposed to be edited by the developers. It should be + the second actions file loaded.

    +
  • + +
  • +

    user.action - is intended to be for + local site preferences and exceptions. As an example, if your ISP or + your bank has specific requirements, and need special handling, this + kind of thing should go here. This file will not be upgraded.

    +
  • + +
  • +

    Edit Set to + Cautious Set to Medium + Set to Advanced

    + +

    These have increasing levels of aggressiveness and have no influence on your browsing unless + you select them explicitly in the editor. A default + installation should be pre-set to Cautious. + New users should try this for a while before adjusting the settings + to more aggressive levels. The more aggressive the settings, then the + more likelihood there is of problems such as sites not working as + they should.

    + +

    The Edit button allows you to turn + each action on/off individually for fine-tuning. The Cautious button changes the actions list to + low/safe settings which will activate ad blocking and a minimal set + of Privoxy's features, and + subsequently there will be less of a chance for accidental problems. + The Medium button sets the list to a + medium level of other features and a low level set of privacy + features. The Advanced button sets the + list to a high level of ad blocking and medium level of privacy. See + the chart below. The latter three buttons over-ride any changes via + with the Edit button. More fine-tuning + can be done in the lower sections of this internal page.

    + +

    While the actions file editor allows to enable these settings in + all actions files, they are only supposed to be enabled in the first + one to make sure you don't unintentionally overrule earlier + rules.

    + +

    The default profiles, and their associated actions, as pre-defined + in default.action are:

    + +
    + + +

    Table 1. Default Configurations

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FeatureCautiousMediumAdvanced
    Ad-blocking Aggressivenessmediumhighhigh
    Ad-filtering by sizenoyesyes
    Ad-filtering by linknonoyes
    Pop-up killingblocks onlyblocks onlyblocks only
    Privacy Featureslowmediummedium/high
    Cookie handlingnonesession-onlykill
    Referer forgingnoyesyes
    GIF de-animationnoyesyes
    Fast redirectsnonoyes
    HTML tamingnonoyes
    JavaScript tamingnonoyes
    Web-bug killingnoyesyes
    Image tag reorderingnoyesyes
    +
    +
  • +
+ +

The list of actions files to be used are defined in the main + configuration file, and are processed in the order they are defined (e.g. + default.action is typically processed before + user.action). The content of these can all be + viewed and edited from http://config.privoxy.org/show-status. The over-riding + principle when applying actions, is that the last action that matches a + given URL wins. The broadest, most general rules go first (defined in + default.action), followed by any exceptions + (typically also in default.action), which are + then followed lastly by any local preferences (typically in user.action). + Generally, user.action has the last word.

+ +

An actions file typically has multiple sections. If you want to use + "aliases" in an actions file, you have to + place the (optional) alias + section at the top of that file. Then comes the default set of rules + which will apply universally to all sites and pages (be very careful with using such a universal + set in user.action or any other actions file + after default.action, because it will override + the result from consulting any previous file). And then below that, + exceptions to the defined universal policies. You can regard user.action as an appendix to default.action, with the advantage that it is a separate + file, which makes preserving your personal settings across Privoxy upgrades easier.

+ +

Actions can be used to block anything you want, including ads, + banners, or just some obnoxious URL whose content you would rather not + see. Cookies can be accepted or rejected, or accepted only during the + current browser session (i.e. not written to disk), content can be + modified, some JavaScripts tamed, user-tracking fooled, and much more. + See below for a complete list of + actions.

+ +
+

8.1. Finding the Right + Mix

+ +

Note that some actions, like + cookie suppression or script disabling, may render some sites unusable + that rely on these techniques to work properly. Finding the right mix + of actions is not always easy and certainly a matter of personal taste. + And, things can always change, requiring refinements in the + configuration. In general, it can be said that the more "aggressive" your default settings (in the top section + of the actions file) are, the more exceptions for "trusted" sites you will have to make later. If, for + example, you want to crunch all cookies per default, you'll have to + make exceptions from that rule for sites that you regularly use and + that require cookies for actually useful purposes, like maybe your + bank, favorite shop, or newspaper.

+ +

We have tried to provide you with reasonable rules to start from in + the distribution actions files. But there is no general rule of thumb + on these things. There just are too many variables, and sites are + constantly changing. Sooner or later you will want to change the rules + (and read this chapter again :).

+
+ +
+

8.2. How to + Edit

+ +

The easiest way to edit the actions files is with a browser by using + our browser-based editor, which can be reached from http://config.privoxy.org/show-status. Note: the config file + option enable-edit-actions must be + enabled for this to work. The editor allows both fine-grained control + over every single feature on a per-URL basis, and easy choosing from + wholesale sets of defaults like "Cautious", + "Medium" or "Advanced". Warning: the "Advanced" setting is more aggressive, and will be more + likely to cause problems for some sites. Experienced users only!

+ +

If you prefer plain text editing to GUIs, you can of course also + directly edit the the actions files with your favorite text editor. + Look at default.action which is richly + commented with many good examples.

+
+ +
+

8.3. How + Actions are Applied to Requests

+ +

Actions files are divided into sections. There are special sections, + like the "alias" sections which will be + discussed later. For now let's concentrate on regular sections: They + have a heading line (often split up to multiple lines for readability) + which consist of a list of actions, separated by whitespace and + enclosed in curly braces. Below that, there is a list of URL and tag + patterns, each on a separate line.

+ +

To determine which actions apply to a request, the URL of the + request is compared to all URL patterns in each "action file". Every time it matches, the list of + applicable actions for the request is incrementally updated, using the + heading of the section in which the pattern is located. The same is + done again for tags and tag patterns later on.

+ +

If multiple applying sections set the same action differently, the + last match wins. If not, the effects are aggregated. E.g. a URL might + match a regular section with a heading line of { + +handle-as-image + }, then later another one with just { + +block }, resulting in + both actions to apply. And + there may well be cases where you will want to combine actions + together. Such a section then might look like:

+ + + +
+
+  { +handle-as-image  +block{Banner ads.} }
   # Block these as if they were images. Send no block page.
    banners.example.com
    media.example.com/.*banners
-   .example.com/images/ads/
-

You can trace this process for URL patterns and any given URL by visiting http://config.privoxy.org/show-url-info.

Examples and more detail on this is provided in the Appendix, Troubleshooting: Anatomy of an Action section.

8.4. Patterns

- As mentioned, Privoxy uses "patterns" - to determine what actions might apply to which sites and - pages your browser attempts to access. These "patterns" use wild - card type pattern matching to achieve a high degree of - flexibility. This allows one expression to be expanded and potentially match - against many similar patterns.

Generally, an URL pattern has the form - <domain><port>/<path>, where the - <domain>, the <port> - and the <path> are optional. (This is why the special - / pattern matches all URLs). Note that the protocol - portion of the URL pattern (e.g. http://) should - not be included in the pattern. This is assumed already!

The pattern matching syntax is different for the domain and path parts of - the URL. The domain part uses a simple globbing type matching technique, - while the path part uses more flexible - "Regular - Expressions" (POSIX 1003.2).

The port part of a pattern is a decimal port number preceded by a colon - (:). If the domain part contains a numerical IPv6 address, - it has to be put into angle brackets - (<, >).

www.example.com/

is a domain-only pattern and will match any request to www.example.com, - regardless of which document on that server is requested. So ALL pages in - this domain would be covered by the scope of this action. Note that a - simple example.com is different and would NOT match. -

www.example.com

means exactly the same. For domain-only patterns, the trailing / may - be omitted. -

www.example.com/index.html

matches all the documents on www.example.com - whose name starts with /index.html. -

www.example.com/index.html$

matches only the single document /index.html - on www.example.com. -

/index.html$

matches the document /index.html, regardless of the domain, - i.e. on any web server anywhere. -

/

Matches any URL because there's no requirement for either the - domain or the path to match anything. -

:8000/

Matches any URL pointing to TCP port 8000. -

<2001:db8::1>/

Matches any URL with the host address 2001:db8::1. - (Note that the real URL uses plain brackets, not angle brackets.) -

index.html

matches nothing, since it would be interpreted as a domain name and - there is no top-level domain called .html. So its - a mistake. -

8.4.1. The Domain Pattern

The matching of the domain part offers some flexible options: if the - domain starts or ends with a dot, it becomes unanchored at that end. - For example:

.example.com

matches any domain with first-level domain com - and second-level domain example. - For example www.example.com, - example.com and foo.bar.baz.example.com. - Note that it wouldn't match if the second-level domain was another-example. -

www.

matches any domain that STARTS with - www. (It also matches the domain - www but most of the time that doesn't matter.) -

.example.

matches any domain that CONTAINS .example.. - And, by the way, also included would be any files or documents that exist - within that domain since no path limitations are specified. (Correctly - speaking: It matches any FQDN that contains example as - a domain.) This might be www.example.com, - news.example.de, or - www.example.net/cgi/testing.pl for instance. All these - cases are matched. -

Additionally, there are wild-cards that you can use in the domain names - themselves. These work similarly to shell globbing type wild-cards: - "*" represents zero or more arbitrary characters (this is - equivalent to the - "Regular - Expression" based syntax of ".*"), - "?" represents any single character (this is equivalent to the - regular expression syntax of a simple "."), and you can define - "character classes" in square brackets which is similar to - the same regular expression technique. All of this can be freely mixed:

ad*.example.com

matches "adserver.example.com", - "ads.example.com", etc but not "sfads.example.com" -

*ad*.example.com

matches all of the above, and then some. -

.?pix.com

matches www.ipix.com, - pictures.epix.com, a.b.c.d.e.upix.com etc. -

www[1-9a-ez].example.c*

matches www1.example.com, - www4.example.cc, wwwd.example.cy, - wwwz.example.com etc., but not - wwww.example.com. -

While flexible, this is not the sophistication of full regular expression based syntax.

8.4.2. The Path Pattern

Privoxy uses "modern" POSIX 1003.2 - "Regular - Expressions" for matching the path portion (after the slash), - and is thus more flexible.

There is an Appendix with a brief quick-start into regular - expressions, you also might want to have a look at your operating system's documentation - on regular expressions (try man re_format).

Note that the path pattern is automatically left-anchored at the "/", - i.e. it matches as if it would start with a "^" (regular expression speak - for the beginning of a line).

Please also note that matching in the path is CASE INSENSITIVE - by default, but you can switch to case sensitive at any point in the pattern by using the - "(?-i)" switch: www.example.com/(?-i)PaTtErN.* will match - only documents whose path starts with PaTtErN in - exactly this capitalization.

.example.com/.*

Is equivalent to just ".example.com", since any documents - within that domain are matched with or without the ".*" - regular expression. This is redundant -

.example.com/.*/index.html$

Will match any page in the domain of "example.com" that is - named "index.html", and that is part of some path. For - example, it matches "www.example.com/testing/index.html" but - NOT "www.example.com/index.html" because the regular - expression called for at least two "/'s", thus the path - requirement. It also would match - "www.example.com/testing/index_html", because of the - special meta-character ".". -

.example.com/(.*/)?index\.html$

This regular expression is conditional so it will match any page - named "index.html" regardless of path which in this case can - have one or more "/'s". And this one must contain exactly - ".html" (but does not have to end with that!). -

.example.com/(.*/)(ads|banners?|junk)

This regular expression will match any path of "example.com" - that contains any of the words "ads", "banner", - "banners" (because of the "?") or "junk". - The path does not have to end in these words, just contain them. -

.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$

This is very much the same as above, except now it must end in either - ".jpg", ".jpeg", ".gif" or ".png". So this - one is limited to common image formats. -

There are many, many good examples to be found in default.action, - and more tutorials below in Appendix on regular expressions.

8.4.3. The Tag Pattern

Tag patterns are used to change the applying actions based on the - request's tags. Tags can be created with either the - client-header-tagger - or the server-header-tagger action.

Tag patterns have to start with "TAG:", so Privoxy - can tell them apart from URL patterns. Everything after the colon - including white space, is interpreted as a regular expression with - path pattern syntax, except that tag patterns aren't left-anchored - automatically (Privoxy doesn't silently add a "^", - you have to do it yourself if you need it).

To match all requests that are tagged with "foo" - your pattern line should be "TAG:^foo$", - "TAG:foo" would work as well, but it would also - match requests whose tags contain "foo" somewhere. - "TAG: foo" wouldn't work as it requires white space.

Sections can contain URL and tag patterns at the same time, - but tag patterns are checked after the URL patterns and thus - always overrule them, even if they are located before the URL patterns.

Once a new tag is added, Privoxy checks right away if it's matched by one - of the tag patterns and updates the action settings accordingly. As a result - tags can be used to activate other tagger actions, as long as these other - taggers look for headers that haven't already be parsed.

For example you could tag client requests which use the - POST method, - then use this tag to activate another tagger that adds a tag if cookies - are sent, and then use a block action based on the cookie tag. This allows - the outcome of one action, to be input into a subsequent action. However if - you'd reverse the position of the described taggers, and activated the - method tagger based on the cookie tagger, no method tags would be created. - The method tagger would look for the request line, but at the time - the cookie tag is created, the request line has already been parsed.

While this is a limitation you should be aware of, this kind of - indirection is seldom needed anyway and even the example doesn't - make too much sense.

8.5. Actions

All actions are disabled by default, until they are explicitly enabled - somewhere in an actions file. Actions are turned on if preceded with a - "+", and turned off if preceded with a "-". So a - +action means "do that action", e.g. - +block means "please block URLs that match the - following patterns", and -block means "don't - block URLs that match the following patterns, even if +block - previously applied."

- Again, actions are invoked by placing them on a line, enclosed in curly braces and - separated by whitespace, like in - {+some-action -some-other-action{some-parameter}}, - followed by a list of URL patterns, one per line, to which they apply. - Together, the actions line and the following pattern lines make up a section - of the actions file.

- Actions fall into three categories:

  • - Boolean, i.e the action can only be "enabled" or - "disabled". Syntax: -

      +name        # enable action name
    -  -name        # disable action name
    -

    - Example: +handle-as-image -

  • - Parameterized, where some value is required in order to enable this type of action. - Syntax: -

    + +
      +name{param}  # enable action and set parameter to param,
    +   .example.com/images/ads/
    +
    +
    + +

    You can trace this process for URL patterns and any given URL by + visiting http://config.privoxy.org/show-url-info.

    + +

    Examples and more detail on this is provided in the Appendix, + Troubleshooting: Anatomy of an + Action section.

    +
+ +
+

8.4. + Patterns

+ +

As mentioned, Privoxy uses + "patterns" to determine what actions might apply to which sites and + pages your browser attempts to access. These "patterns" use wild card type pattern matching to achieve a high degree + of flexibility. This allows one expression to be expanded and + potentially match against many similar patterns.

+ +

Generally, an URL pattern has the form <domain><port>/<path>, where the + <domain>, the <port> and the <path> are optional. (This is why the special + / pattern matches all URLs). Note that the + protocol portion of the URL pattern (e.g. http://) should not be included in the pattern. This is + assumed already!

+ +

The pattern matching syntax is different for the domain and path + parts of the URL. The domain part uses a simple globbing type matching + technique, while the path part uses more flexible "Regular Expressions" (POSIX + 1003.2).

+ +

The port part of a pattern is a decimal port number preceded by a + colon (:). If the domain part contains a + numerical IPv6 address, it has to be put into angle brackets + (<, >).

+ +
+
+
www.example.com/
+ +
+

is a domain-only pattern and will match any request to + www.example.com, regardless of which + document on that server is requested. So ALL pages in this domain + would be covered by the scope of this action. Note that a simple + example.com is different and would NOT + match.

+
+ +
www.example.com
+ +
+

means exactly the same. For domain-only patterns, the trailing + / may be omitted.

+
+ +
www.example.com/index.html
+ +
+

matches all the documents on www.example.com whose name starts with /index.html.

+
+ +
www.example.com/index.html$
+ +
+

matches only the single document /index.html on www.example.com.

+
+ +
/index.html$
+ +
+

matches the document /index.html, + regardless of the domain, i.e. on any web server anywhere.

+
+ +
/
+ +
+

Matches any URL because there's no requirement for either the + domain or the path to match anything.

+
+ +
:8000/
+ +
+

Matches any URL pointing to TCP port 8000.

+
+ +
<2001:db8::1>/
+ +
+

Matches any URL with the host address 2001:db8::1. (Note that the real URL uses plain + brackets, not angle brackets.)

+
+ +
index.html
+ +
+

matches nothing, since it would be interpreted as a domain + name and there is no top-level domain called .html. So its a mistake.

+
+
+
+ +
+

8.4.1. The Domain + Pattern

+ +

The matching of the domain part offers some flexible options: if + the domain starts or ends with a dot, it becomes unanchored at that + end. For example:

+ +
+
+
.example.com
+ +
+

matches any domain with first-level domain com and second-level domain example. For example www.example.com, example.com and foo.bar.baz.example.com. Note that it wouldn't + match if the second-level domain was another-example.

+
+ +
www.
+ +
+

matches any domain that STARTS with www. (It also matches the domain www but most of the time that doesn't + matter.)

+
+ +
.example.
+ +
+

matches any domain that CONTAINS .example.. And, by the way, also included would + be any files or documents that exist within that domain since + no path limitations are specified. (Correctly speaking: It + matches any FQDN that contains example + as a domain.) This might be www.example.com, news.example.de, or www.example.net/cgi/testing.pl for instance. All + these cases are matched.

+
+
+
+ +

Additionally, there are wild-cards that you can use in the domain + names themselves. These work similarly to shell globbing type + wild-cards: "*" represents zero or more + arbitrary characters (this is equivalent to the "Regular Expression" based + syntax of ".*"), "?" represents any single character (this is + equivalent to the regular expression syntax of a simple "."), and you can define "character classes" in square brackets which is + similar to the same regular expression technique. All of this can be + freely mixed:

+ +
+
+
ad*.example.com
+ +
+

matches "adserver.example.com", + "ads.example.com", etc but not + "sfads.example.com"

+
+ +
*ad*.example.com
+ +
+

matches all of the above, and then some.

+
+ +
.?pix.com
+ +
+

matches www.ipix.com, pictures.epix.com, a.b.c.d.e.upix.com etc.

+
+ +
www[1-9a-ez].example.c*
+ +
+

matches www1.example.com, + www4.example.cc, wwwd.example.cy, wwwz.example.com etc., but not wwww.example.com.

+
+
+
+ +

While flexible, this is not the sophistication of full regular + expression based syntax.

+
+ +
+

8.4.2. The Path + Pattern

+ +

Privoxy uses "modern" POSIX 1003.2 "Regular Expressions" for + matching the path portion (after the slash), and is thus more + flexible.

+ +

There is an Appendix with a + brief quick-start into regular expressions, you also might want to + have a look at your operating system's documentation on regular + expressions (try man re_format).

+ +

Note that the path pattern is automatically left-anchored at the + "/", i.e. it matches as if it would start + with a "^" (regular expression speak for + the beginning of a line).

+ +

Please also note that matching in the path is CASE INSENSITIVE by default, but you + can switch to case sensitive at any point in the pattern by using the + "(?-i)" switch: www.example.com/(?-i)PaTtErN.* will match only + documents whose path starts with PaTtErN in + exactly this + capitalization.

+ +
+
+
.example.com/.*
+ +
+

Is equivalent to just ".example.com", since any documents within that + domain are matched with or without the ".*" regular expression. This is redundant

+
+ +
.example.com/.*/index.html$
+ +
+

Will match any page in the domain of "example.com" that is named "index.html", and that is part of some path. For + example, it matches "www.example.com/testing/index.html" but NOT + "www.example.com/index.html" because + the regular expression called for at least two "/'s", thus the path requirement. It also would + match "www.example.com/testing/index_html", because of + the special meta-character ".".

+
+ +
.example.com/(.*/)?index\.html$
+ +
+

This regular expression is conditional so it will match any + page named "index.html" regardless + of path which in this case can have one or more "/'s". And this one must contain exactly + ".html" (but does not have to end + with that!).

+
+ +
.example.com/(.*/)(ads|banners?|junk)
+ +
+

This regular expression will match any path of "example.com" that contains any of the words + "ads", "banner", "banners" + (because of the "?") or "junk". The path does not have to end in these + words, just contain them.

+
+ +
.example.com/(.*/)(ads|banners?|junk)/.*\.(jpe?g|gif|png)$
+ +
+

This is very much the same as above, except now it must end + in either ".jpg", ".jpeg", ".gif" or + ".png". So this one is limited to + common image formats.

+
+
+
+ +

There are many, many good examples to be found in default.action, and more tutorials below in Appendix on regular expressions.

+
+ +
+

8.4.3. The + Tag Pattern

+ +

Tag patterns are used to change the applying actions based on the + request's tags. Tags can be created with either the client-header-tagger or + the server-header-tagger + action.

+ +

Tag patterns have to start with "TAG:", + so Privoxy can tell them apart from + URL patterns. Everything after the colon including white space, is + interpreted as a regular expression with path pattern syntax, except + that tag patterns aren't left-anchored automatically (Privoxy doesn't silently add a "^", you have to do it yourself if you need it).

+ +

To match all requests that are tagged with "foo" your pattern line should be "TAG:^foo$", "TAG:foo" + would work as well, but it would also match requests whose tags + contain "foo" somewhere. "TAG: foo" wouldn't work as it requires white + space.

+ +

Sections can contain URL and tag patterns at the same time, but + tag patterns are checked after the URL patterns and thus always + overrule them, even if they are located before the URL patterns.

+ +

Once a new tag is added, Privoxy checks right away if it's matched + by one of the tag patterns and updates the action settings + accordingly. As a result tags can be used to activate other tagger + actions, as long as these other taggers look for headers that haven't + already be parsed.

+ +

For example you could tag client requests which use the POST method, then use this tag to activate another + tagger that adds a tag if cookies are sent, and then use a block + action based on the cookie tag. This allows the outcome of one + action, to be input into a subsequent action. However if you'd + reverse the position of the described taggers, and activated the + method tagger based on the cookie tagger, no method tags would be + created. The method tagger would look for the request line, but at + the time the cookie tag is created, the request line has already been + parsed.

+ +

While this is a limitation you should be aware of, this kind of + indirection is seldom needed anyway and even the example doesn't make + too much sense.

+
+
+ +
+

8.5. Actions

+ +

All actions are disabled by default, until they are explicitly + enabled somewhere in an actions file. Actions are turned on if preceded + with a "+", and turned off if preceded with + a "-". So a +action + means "do that action", e.g. +block means "please block URLs that + match the following patterns", and -block means "don't block URLs that + match the following patterns, even if +block + previously applied."

+ +

Again, actions are invoked by placing them on a line, enclosed in + curly braces and separated by whitespace, like in {+some-action -some-other-action{some-parameter}}, + followed by a list of URL patterns, one per line, to which they apply. + Together, the actions line and the following pattern lines make up a + section of the actions file.

+ +

Actions fall into three categories:

+ +
    +
  • +

    Boolean, i.e the action can only be "enabled" or "disabled". + Syntax:

    + + + + + +
    +
    +  +name        # enable action name
    +  -name        # disable action name
    +
    +
    + +

    Example: +handle-as-image

    +
  • + +
  • +

    Parameterized, where some value is required in order to enable + this type of action. Syntax:

    + + + +
    +
    +  +name{param}  # enable action and set parameter to param,
                    # overwriting parameter from previous match if necessary
    -  -name         # disable action. The parameter can be omitted
    -

    Note that if the URL matches multiple positive forms of a parameterized action, - the last match wins, i.e. the params from earlier matches are simply ignored. -

    - Example: +hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602 Firefox/2.0.0.4} -

  • - Multi-value. These look exactly like parameterized actions, - but they behave differently: If the action applies multiple times to the - same URL, but with different parameters, all the parameters - from all matches are remembered. This is used for actions - that can be executed for the same request repeatedly, like adding multiple - headers, or filtering through multiple filters. Syntax: -

    + +
      +name{param}   # enable action and add param to the list of parameters
    -  -name{param}   # remove the parameter param from the list of parameters
    +  -name         # disable action. The parameter can be omitted
    +
    +
    + +

    Note that if the URL matches multiple positive forms of a + parameterized action, the last match wins, i.e. the params from + earlier matches are simply ignored.

    + +

    Example: +hide-user-agent{Mozilla/5.0 (X11; + U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070602 + Firefox/2.0.0.4}

    +
  • + +
  • +

    Multi-value. These look exactly like parameterized actions, but + they behave differently: If the action applies multiple times to + the same URL, but with different parameters, all the parameters from all matches are remembered. This is + used for actions that can be executed for the same request + repeatedly, like adding multiple headers, or filtering through + multiple filters. Syntax:

    + + + +
    +
    +  +name{param}   # enable action and add param to the list of parameters
    +  -name{param}   # remove the parameter param from the list of parameters
                     # If it was the last one left, disable the action.
    -  -name          # disable this action completely and remove all parameters from the list
    -

    - Examples: +add-header{X-Fun-Header: Some text} and - +filter{html-annoyances} -

If nothing is specified in any actions file, no "actions" are - taken. So in this case Privoxy would just be a - normal, non-blocking, non-filtering proxy. You must specifically enable the - privacy and blocking features you need (although the provided default actions - files will give a good starting point).

Later defined action sections always over-ride earlier ones of the same type. - So exceptions to any rules you make, should come in the latter part of the file (or - in a file that is processed later when using multiple actions files such - as user.action). For multi-valued actions, the actions - are applied in the order they are specified. Actions files are processed in - the order they are defined in config (the default - installation has three actions files). It also quite possible for any given - URL to match more than one "pattern" (because of wildcards and - regular expressions), and thus to trigger more than one set of actions! Last - match wins.

The list of valid Privoxy actions are:

8.5.1. add-header

Typical use:

Confuse log analysis, custom applications

Effect:

Sends a user defined HTTP header to the web server. -

Type:

Multi-value.

Parameter:

Any string value is possible. Validity of the defined HTTP headers is not checked. - It is recommended that you use the "X-" prefix - for custom headers. -

Notes:

This action may be specified multiple times, in order to define multiple - headers. This is rarely needed for the typical user. If you don't know what - "HTTP headers" are, you definitely don't need to worry about this - one. -

Headers added by this action are not modified by other actions. -

Example usage:

+add-header{X-User-Tracking: sucks}
-

8.5.2. block

Typical use:

Block ads or other unwanted content

Effect:

Requests for URLs to which this action applies are blocked, i.e. the - requests are trapped by Privoxy and the requested URL is never retrieved, - but is answered locally with a substitute page or image, as determined by - the handle-as-image, - set-image-blocker, and - handle-as-empty-document actions. - -

Type:

Parameterized.

Parameter:

A block reason that should be given to the user.

Notes:

Privoxy sends a special "BLOCKED" page - for requests to blocked pages. This page contains the block reason given as - parameter, a link to find out why the block action applies, and a click-through - to the blocked content (the latter only if the force feature is available and - enabled). -

- A very important exception occurs if both - block and handle-as-image, - apply to the same request: it will then be replaced by an image. If - set-image-blocker - (see below) also applies, the type of image will be determined by its parameter, - if not, the standard checkerboard pattern is sent. -

It is important to understand this process, in order - to understand how Privoxy deals with - ads and other unwanted content. Blocking is a core feature, and one - upon which various other features depend. -

The filter - action can perform a very similar task, by "blocking" - banner images and other content through rewriting the relevant URLs in the - document's HTML source, so they don't get requested in the first place. - Note that this is a totally different technique, and it's easy to confuse the two. -

Example usage (section):

+ +
{+block{No nasty stuff for you.}}
+  -name          # disable this action completely and remove all parameters from the list
+
+
+ +

Examples: +add-header{X-Fun-Header: Some + text} and +filter{html-annoyances}

+ + + +

If nothing is specified in any actions file, no "actions" are taken. So in this case Privoxy would just be a normal, non-blocking, + non-filtering proxy. You must specifically enable the privacy and + blocking features you need (although the provided default actions files + will give a good starting point).

+ +

Later defined action sections always over-ride earlier ones of the + same type. So exceptions to any rules you make, should come in the + latter part of the file (or in a file that is processed later when + using multiple actions files such as user.action). For multi-valued actions, the actions are + applied in the order they are specified. Actions files are processed in + the order they are defined in config (the + default installation has three actions files). It also quite possible + for any given URL to match more than one "pattern" (because of wildcards and regular + expressions), and thus to trigger more than one set of actions! Last + match wins.

+ +

The list of valid Privoxy actions + are:

+ +
+

8.5.1. + add-header

+ +
+
+
Typical use:
+ +
+

Confuse log analysis, custom applications

+
+ +
Effect:
+ +
+

Sends a user defined HTTP header to the web server.

+
+ +
Type:
+ +
+

Multi-value.

+
+ +
Parameter:
+ +
+

Any string value is possible. Validity of the defined HTTP + headers is not checked. It is recommended that you use the + "X-" prefix + for custom headers.

+
+ +
Notes:
+ +
+

This action may be specified multiple times, in order to + define multiple headers. This is rarely needed for the typical + user. If you don't know what "HTTP + headers" are, you definitely don't need to worry about + this one.

+ +

Headers added by this action are not modified by other + actions.

+
+ +
Example usage:
+ +
+ + + + +
+
++add-header{X-User-Tracking: sucks}
+
+
+
+
+
+
+ +
+

8.5.2. block

+ +
+
+
Typical use:
+ +
+

Block ads or other unwanted content

+
+ +
Effect:
+ +
+

Requests for URLs to which this action applies are blocked, + i.e. the requests are trapped by Privoxy and the requested URL is never + retrieved, but is answered locally with a substitute page or + image, as determined by the handle-as-image, + set-image-blocker, + and handle-as-empty-document + actions.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

A block reason that should be given to the user.

+
+ +
Notes:
+ +
+

Privoxy sends a special + "BLOCKED" page for requests to + blocked pages. This page contains the block reason given as + parameter, a link to find out why the block action applies, and + a click-through to the blocked content (the latter only if the + force feature is available and enabled).

+ +

A very important exception occurs if both block and handle-as-image, + apply to the same request: it will then be replaced by an + image. If set-image-blocker + (see below) also applies, the type of image will be determined + by its parameter, if not, the standard checkerboard pattern is + sent.

+ +

It is important to understand this process, in order to + understand how Privoxy deals + with ads and other unwanted content. Blocking is a core + feature, and one upon which various other features depend.

+ +

The filter action can perform a + very similar task, by "blocking" + banner images and other content through rewriting the relevant + URLs in the document's HTML source, so they don't get requested + in the first place. Note that this is a totally different + technique, and it's easy to confuse the two.

+
+ +
Example usage (section):
+ +
+ + +
+
+{+block{No nasty stuff for you.}}
 # Block and replace with "blocked" page
  .nasty-stuff.example.com
 
-{+block{Doubleclick banners.} +handle-as-image} 
+{+block{Doubleclick banners.} +handle-as-image}
 # Block and replace with image
  .ad.doubleclick.net
  .ads.r.us/banners/
 
-{+block{Layered ads.} +handle-as-empty-document} 
+{+block{Layered ads.} +handle-as-empty-document}
 # Block and then ignore
- adserver.example.net/.*\.js$
-

8.5.3. change-x-forwarded-for

Typical use:

Improve privacy by not forwarding the source of the request in the HTTP headers.

Effect:

Deletes the "X-Forwarded-For:" HTTP header from the client request, - or adds a new one. -

Type:

Parameterized.

Parameter:

  • "block" to delete the header.

  • "add" to create the header (or append - the client's IP address to an already existing one). -

Notes:

It is safe and recommended to use block. -

Forwarding the source address of the request may make - sense in some multi-user setups but is also a privacy risk. -

Example usage:

+change-x-forwarded-for{block}
-

8.5.4. client-header-filter

Typical use:

Rewrite or remove single client headers. -

Effect:

All client headers to which this action applies are filtered on-the-fly through - the specified regular expression based substitutions. -

Type:

Parameterized.

Parameter:

The name of a client-header filter, as defined in one of the - filter files. -

Notes:

Client-header filters are applied to each header on its own, not to - all at once. This makes it easier to diagnose problems, but on the downside - you can't write filters that only change header x if header y's value is z. - You can do that by using tags though. -

Client-header filters are executed after the other header actions have finished - and use their output as input. -

If the request URL gets changed, Privoxy will detect that and use the new - one. This can be used to rewrite the request destination behind the client's - back, for example to specify a Tor exit relay for certain requests. -

Please refer to the filter file chapter - to learn which client-header filters are available by default, and how to - create your own. -

Example usage (section):

+ +
# Hide Tor exit notation in Host and Referer Headers
+ adserver.example.net/.*\.js$
+
+
+

+
+
+
+ +
+

8.5.3. change-x-forwarded-for

+ +
+
+
Typical use:
+ +
+

Improve privacy by not forwarding the source of the request + in the HTTP headers.

+
+ +
Effect:
+ +
+

Deletes the "X-Forwarded-For:" + HTTP header from the client request, or adds a new one.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+
    +
  • +

    "block" to delete the + header.

    +
  • + +
  • +

    "add" to create the header + (or append the client's IP address to an already existing + one).

    +
  • +
+
+ +
Notes:
+ +
+

It is safe and recommended to use block.

+ +

Forwarding the source address of the request may make sense + in some multi-user setups but is also a privacy risk.

+
+ +
Example usage:
+ +
+ + + + +
+
++change-x-forwarded-for{block}
+
+
+
+
+
+
+ +
+

8.5.4. client-header-filter

+ +
+
+
Typical use:
+ +
+

Rewrite or remove single client headers.

+
+ +
Effect:
+ +
+

All client headers to which this action applies are filtered + on-the-fly through the specified regular expression based + substitutions.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

The name of a client-header filter, as defined in one of the + filter files.

+
+ +
Notes:
+ +
+

Client-header filters are applied to each header on its own, + not to all at once. This makes it easier to diagnose problems, + but on the downside you can't write filters that only change + header x if header y's value is z. You can do that by using + tags though.

+ +

Client-header filters are executed after the other header + actions have finished and use their output as input.

+ +

If the request URL gets changed, Privoxy will detect that and use the new + one. This can be used to rewrite the request destination behind + the client's back, for example to specify a Tor exit relay for + certain requests.

+ +

Please refer to the filter file + chapter to learn which client-header filters are available + by default, and how to create your own.

+
+ +
Example usage (section):
+ +
+ + +
+
+# Hide Tor exit notation in Host and Referer Headers
 {+client-header-filter{hide-tor-exit-notation}}
 /
-    
-

8.5.5. client-header-tagger

Typical use:

Block requests based on their headers. -

Effect:

Client headers to which this action applies are filtered on-the-fly through - the specified regular expression based substitutions, the result is used as - tag. -

Type:

Parameterized.

Parameter:

The name of a client-header tagger, as defined in one of the - filter files. -

Notes:

Client-header taggers are applied to each header on its own, - and as the header isn't modified, each tagger "sees" - the original. -

Client-header taggers are the first actions that are executed - and their tags can be used to control every other action. -

Example usage (section):

+ +
# Tag every request with the User-Agent header
+
+
+
+

+
+
+
+ +
+

8.5.5. client-header-tagger

+ +
+
+
Typical use:
+ +
+

Block requests based on their headers.

+
+ +
Effect:
+ +
+

Client headers to which this action applies are filtered + on-the-fly through the specified regular expression based + substitutions, the result is used as tag.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

The name of a client-header tagger, as defined in one of the + filter files.

+
+ +
Notes:
+ +
+

Client-header taggers are applied to each header on its own, + and as the header isn't modified, each tagger "sees" the original.

+ +

Client-header taggers are the first actions that are + executed and their tags can be used to control every other + action.

+
+ +
Example usage (section):
+ +
+ + +
+
+# Tag every request with the User-Agent header
 {+client-header-tagger{user-agent}}
 /
 
@@ -2309,3479 +1317,2314 @@
 TAG:^User-Agent: fetch libfetch/
 TAG:^User-Agent: Ubuntu APT-HTTP/
 TAG:^User-Agent: MPlayer/
-    
-

8.5.6. content-type-overwrite

Typical use:

Stop useless download menus from popping up, or change the browser's rendering mode

Effect:

Replaces the "Content-Type:" HTTP server header. -

Type:

Parameterized.

Parameter:

Any string. -

Notes:

The "Content-Type:" HTTP server header is used by the - browser to decide what to do with the document. The value of this - header can cause the browser to open a download menu instead of - displaying the document by itself, even if the document's format is - supported by the browser. -

The declared content type can also affect which rendering mode - the browser chooses. If XHTML is delivered as "text/html", - many browsers treat it as yet another broken HTML document. - If it is send as "application/xml", browsers with - XHTML support will only display it, if the syntax is correct. -

If you see a web site that proudly uses XHTML buttons, but sets - "Content-Type: text/html", you can use Privoxy - to overwrite it with "application/xml" and validate - the web master's claim inside your XHTML-supporting browser. - If the syntax is incorrect, the browser will complain loudly. -

You can also go the opposite direction: if your browser prints - error messages instead of rendering a document falsely declared - as XHTML, you can overwrite the content type with - "text/html" and have it rendered as broken HTML document. -

By default content-type-overwrite only replaces - "Content-Type:" headers that look like some kind of text. - If you want to overwrite it unconditionally, you have to combine it with - force-text-mode. - This limitation exists for a reason, think twice before circumventing it. -

Most of the time it's easier to replace this action with a custom - server-header filter. - It allows you to activate it for every document of a certain site and it will still - only replace the content types you aimed at. -

Of course you can apply content-type-overwrite - to a whole site and then make URL based exceptions, but it's a lot - more work to get the same precision. -

Example usage (sections):

# Check if www.example.net/ really uses valid XHTML
-{ +content-type-overwrite{application/xml} }
-www.example.net/
 
-# but leave the content type unmodified if the URL looks like a style sheet
-{-content-type-overwrite}
-www.example.net/.*\.css$
-www.example.net/.*style
-

8.5.7. crunch-client-header

Typical use:

Remove a client header Privoxy has no dedicated action for.

Effect:

Deletes every header sent by the client that contains the string the user supplied as parameter. -

Type:

Parameterized.

Parameter:

Any string. -

Notes:

This action allows you to block client headers for which no dedicated - Privoxy action exists. - Privoxy will remove every client header that - contains the string you supplied as parameter. -

Regular expressions are not supported and you can't - use this action to block different headers in the same request, unless - they contain the same string. -

crunch-client-header is only meant for quick tests. - If you have to block several different headers, or only want to modify - parts of them, you should use a - client-header filter. -

Warning

Don't block any header without understanding the consequences. -

Example usage (section):

+ +
# Block the non-existent "Privacy-Violation:" client header 
-{ +crunch-client-header{Privacy-Violation:} }
+
+
+

+
+
+
+ +
+

8.5.6. content-type-overwrite

+ +
+
+
Typical use:
+ +
+

Stop useless download menus from popping up, or change the + browser's rendering mode

+
+ +
Effect:
+ +
+

Replaces the "Content-Type:" HTTP + server header.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Any string.

+
+ +
Notes:
+ +
+

The "Content-Type:" HTTP server + header is used by the browser to decide what to do with the + document. The value of this header can cause the browser to + open a download menu instead of displaying the document by + itself, even if the document's format is supported by the + browser.

+ +

The declared content type can also affect which rendering + mode the browser chooses. If XHTML is delivered as "text/html", many browsers treat it as yet + another broken HTML document. If it is send as "application/xml", browsers with XHTML support + will only display it, if the syntax is correct.

+ +

If you see a web site that proudly uses XHTML buttons, but + sets "Content-Type: text/html", you + can use Privoxy to overwrite + it with "application/xml" and + validate the web master's claim inside your XHTML-supporting + browser. If the syntax is incorrect, the browser will complain + loudly.

+ +

You can also go the opposite direction: if your browser + prints error messages instead of rendering a document falsely + declared as XHTML, you can overwrite the content type with + "text/html" and have it rendered as + broken HTML document.

+ +

By default content-type-overwrite + only replaces "Content-Type:" + headers that look like some kind of text. If you want to + overwrite it unconditionally, you have to combine it with + force-text-mode. + This limitation exists for a reason, think twice before + circumventing it.

+ +

Most of the time it's easier to replace this action with a + custom server-header + filter. It allows you to activate it for every + document of a certain site and it will still only replace the + content types you aimed at.

+ +

Of course you can apply content-type-overwrite to a whole site and then + make URL based exceptions, but it's a lot more work to get the + same precision.

+
+ +
Example usage (sections):
+ +
+ + + + +
+
+# Check if www.example.net/ really uses valid XHTML
+{ +content-type-overwrite{application/xml} }
+www.example.net/
+
+# but leave the content type unmodified if the URL looks like a style sheet
+{-content-type-overwrite}
+www.example.net/.*\.css$
+www.example.net/.*style
+
+
+
+
+
+
+ +
+

8.5.7. crunch-client-header

+ +
+
+
Typical use:
+ +
+

Remove a client header Privoxy has no dedicated action for.

+
+ +
Effect:
+ +
+

Deletes every header sent by the client that contains the + string the user supplied as parameter.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Any string.

+
+ +
Notes:
+ +
+

This action allows you to block client headers for which no + dedicated Privoxy action + exists. Privoxy will remove + every client header that contains the string you supplied as + parameter.

+ +

Regular expressions are not supported and you can't use + this action to block different headers in the same request, + unless they contain the same string.

+ +

crunch-client-header is only meant + for quick tests. If you have to block several different + headers, or only want to modify parts of them, you should use a + client-header + filter.

+ +
+ + + + + + + + +
Warning
+

Don't block any header without understanding the + consequences.

+
+
+
+ +
Example usage (section):
+ +
+ + +
+
+# Block the non-existent "Privacy-Violation:" client header
+{ +crunch-client-header{Privacy-Violation:} }
 /
-    
-

8.5.8. crunch-if-none-match

Typical use:

Prevent yet another way to track the user's steps between sessions.

Effect:

Deletes the "If-None-Match:" HTTP client header. -

Type:

Boolean.

Parameter:

N/A -

Notes:

Removing the "If-None-Match:" HTTP client header - is useful for filter testing, where you want to force a real - reload instead of getting status code "304" which - would cause the browser to use a cached copy of the page. -

It is also useful to make sure the header isn't used as a cookie - replacement (unlikely but possible). -

Blocking the "If-None-Match:" header shouldn't cause any - caching problems, as long as the "If-Modified-Since:" header - isn't blocked or missing as well. -

It is recommended to use this action together with - hide-if-modified-since - and - overwrite-last-modified. -

Example usage (section):

+ +
# Let the browser revalidate cached documents but don't
+
+
+
+

+
+
+
+ +
+

8.5.8. crunch-if-none-match

+ +
+
+
Typical use:
+ +
+

Prevent yet another way to track the user's steps between + sessions.

+
+ +
Effect:
+ +
+

Deletes the "If-None-Match:" HTTP + client header.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

Removing the "If-None-Match:" + HTTP client header is useful for filter testing, where you want + to force a real reload instead of getting status code + "304" which would cause the browser + to use a cached copy of the page.

+ +

It is also useful to make sure the header isn't used as a + cookie replacement (unlikely but possible).

+ +

Blocking the "If-None-Match:" + header shouldn't cause any caching problems, as long as the + "If-Modified-Since:" header isn't + blocked or missing as well.

+ +

It is recommended to use this action together with + hide-if-modified-since + and overwrite-last-modified.

+
+ +
Example usage (section):
+ +
+ + +
+
+# Let the browser revalidate cached documents but don't
 # allow the server to use the revalidation headers for user tracking.
 {+hide-if-modified-since{-60} \
  +overwrite-last-modified{randomize} \
  +crunch-if-none-match}
-/   
-

8.5.9. crunch-incoming-cookies

Typical use:

Prevent the web server from setting HTTP cookies on your system -

Effect:

Deletes any "Set-Cookie:" HTTP headers from server replies. -

Type:

Boolean.

Parameter:

N/A -

Notes:

This action is only concerned with incoming HTTP cookies. For - outgoing HTTP cookies, use - crunch-outgoing-cookies. - Use both to disable HTTP cookies completely. -

It makes no sense at all to use this action in conjunction - with the session-cookies-only action, - since it would prevent the session cookies from being set. See also - filter-content-cookies. -

Example usage:

+crunch-incoming-cookies
-

8.5.10. crunch-server-header

Typical use:

Remove a server header Privoxy has no dedicated action for.

Effect:

Deletes every header sent by the server that contains the string the user supplied as parameter. -

Type:

Parameterized.

Parameter:

Any string. -

Notes:

This action allows you to block server headers for which no dedicated - Privoxy action exists. Privoxy - will remove every server header that contains the string you supplied as parameter. -

Regular expressions are not supported and you can't - use this action to block different headers in the same request, unless - they contain the same string. -

crunch-server-header is only meant for quick tests. - If you have to block several different headers, or only want to modify - parts of them, you should use a custom - server-header filter. -

Warning

Don't block any header without understanding the consequences. -

Example usage (section):

+ +
# Crunch server headers that try to prevent caching
+/
+
+
+

+
+
+
+ +
+

8.5.9. crunch-incoming-cookies

+ +
+
+
Typical use:
+ +
+

Prevent the web server from setting HTTP cookies on your + system

+
+ +
Effect:
+ +
+

Deletes any "Set-Cookie:" HTTP + headers from server replies.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

This action is only concerned with incoming HTTP cookies. For + outgoing HTTP + cookies, use crunch-outgoing-cookies. + Use both to disable + HTTP cookies completely.

+ +

It makes no sense at + all to use this action in conjunction with the + session-cookies-only + action, since it would prevent the session cookies from being + set. See also filter-content-cookies.

+
+ +
Example usage:
+ +
+ + + + +
+
++crunch-incoming-cookies
+
+
+
+
+
+
+ +
+

8.5.10. crunch-server-header

+ +
+
+
Typical use:
+ +
+

Remove a server header Privoxy has no dedicated action for.

+
+ +
Effect:
+ +
+

Deletes every header sent by the server that contains the + string the user supplied as parameter.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Any string.

+
+ +
Notes:
+ +
+

This action allows you to block server headers for which no + dedicated Privoxy action + exists. Privoxy will remove + every server header that contains the string you supplied as + parameter.

+ +

Regular expressions are not supported and you can't use + this action to block different headers in the same request, + unless they contain the same string.

+ +

crunch-server-header is only meant + for quick tests. If you have to block several different + headers, or only want to modify parts of them, you should use a + custom server-header + filter.

+ +
+ + + + + + + + +
Warning
+

Don't block any header without understanding the + consequences.

+
+
+
+ +
Example usage (section):
+ +
+ + +
+
+# Crunch server headers that try to prevent caching
 { +crunch-server-header{no-cache} }
-/   
-

8.5.11. crunch-outgoing-cookies

Typical use:

Prevent the web server from reading any HTTP cookies from your system -

Effect:

Deletes any "Cookie:" HTTP headers from client requests. -

Type:

Boolean.

Parameter:

N/A -

Notes:

This action is only concerned with outgoing HTTP cookies. For - incoming HTTP cookies, use - crunch-incoming-cookies. - Use both to disable HTTP cookies completely. -

It makes no sense at all to use this action in conjunction - with the session-cookies-only action, - since it would prevent the session cookies from being read. -

Example usage:

+crunch-outgoing-cookies
-

8.5.12. deanimate-gifs

Typical use:

Stop those annoying, distracting animated GIF images.

Effect:

De-animate GIF animations, i.e. reduce them to their first or last image. -

Type:

Parameterized.

Parameter:

"last" or "first" -

Notes:

This will also shrink the images considerably (in bytes, not pixels!). If - the option "first" is given, the first frame of the animation - is used as the replacement. If "last" is given, the last - frame of the animation is used instead, which probably makes more sense for - most banner animations, but also has the risk of not showing the entire - last frame (if it is only a delta to an earlier frame). -

You can safely use this action with patterns that will also match non-GIF - objects, because no attempt will be made at anything that doesn't look like - a GIF. -

Example usage:

+deanimate-gifs{last}
-

8.5.13. downgrade-http-version

Typical use:

Work around (very rare) problems with HTTP/1.1

Effect:

Downgrades HTTP/1.1 client requests and server replies to HTTP/1.0. -

Type:

Boolean.

Parameter:

N/A -

Notes:

This is a left-over from the time when Privoxy - didn't support important HTTP/1.1 features well. It is left here for the - unlikely case that you experience HTTP/1.1 related problems with some server - out there. Not all HTTP/1.1 features and requirements are supported yet, - so there is a chance you might need this action. -

Example usage (section):

{+downgrade-http-version}
-problem-host.example.com
-

8.5.14. fast-redirects

Typical use:

Fool some click-tracking scripts and speed up indirect links.

Effect:

Detects redirection URLs and redirects the browser without contacting - the redirection server first. -

Type:

Parameterized.

Parameter:

  • "simple-check" to just search for the string "http://" - to detect redirection URLs. -

  • "check-decoded-url" to decode URLs (if necessary) before searching - for redirection URLs. -

Notes:

- Many sites, like yahoo.com, don't just link to other sites. Instead, they - will link to some script on their own servers, giving the destination as a - parameter, which will then redirect you to the final target. URLs - resulting from this scheme typically look like: - "http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/". -

Sometimes, there are even multiple consecutive redirects encoded in the - URL. These redirections via scripts make your web browsing more traceable, - since the server from which you follow such a link can see where you go - to. Apart from that, valuable bandwidth and time is wasted, while your - browser asks the server for one redirect after the other. Plus, it feeds - the advertisers. -

This feature is currently not very smart and is scheduled for improvement. - If it is enabled by default, you will have to create some exceptions to - this action. It can lead to failures in several ways: -

Not every URLs with other URLs as parameters is evil. - Some sites offer a real service that requires this information to work. - For example a validation service needs to know, which document to validate. - fast-redirects assumes that every URL parameter that - looks like another URL is a redirection target, and will always redirect to - the last one. Most of the time the assumption is correct, but if it isn't, - the user gets redirected anyway. -

Another failure occurs if the URL contains other parameters after the URL parameter. - The URL: - "http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar". - contains the redirection URL "http://www.example.net/", - followed by another parameter. fast-redirects doesn't know that - and will cause a redirect to "http://www.example.net/&foo=bar". - Depending on the target server configuration, the parameter will be silently ignored - or lead to a "page not found" error. You can prevent this problem by - first using the redirect action - to remove the last part of the URL, but it requires a little effort. -

To detect a redirection URL, fast-redirects only - looks for the string "http://", either in plain text - (invalid but often used) or encoded as "http%3a//". - Some sites use their own URL encoding scheme, encrypt the address - of the target server or replace it with a database id. In theses cases - fast-redirects is fooled and the request reaches the - redirection server where it probably gets logged. -

Example usage:

+ +
 { +fast-redirects{simple-check} }
-   one.example.com 
+/
+
+
+

+
+
+
+ +
+

8.5.11. crunch-outgoing-cookies

+ +
+
+
Typical use:
+ +
+

Prevent the web server from reading any HTTP cookies from + your system

+
+ +
Effect:
+ +
+

Deletes any "Cookie:" HTTP + headers from client requests.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

This action is only concerned with outgoing HTTP cookies. For + incoming HTTP + cookies, use crunch-incoming-cookies. + Use both to disable + HTTP cookies completely.

+ +

It makes no sense at + all to use this action in conjunction with the + session-cookies-only + action, since it would prevent the session cookies from being + read.

+
+ +
Example usage:
+ +
+ + + + +
+
++crunch-outgoing-cookies
+
+
+
+
+
+
+ +
+

8.5.12. deanimate-gifs

+ +
+
+
Typical use:
+ +
+

Stop those annoying, distracting animated GIF images.

+
+ +
Effect:
+ +
+

De-animate GIF animations, i.e. reduce them to their first + or last image.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

"last" or "first"

+
+ +
Notes:
+ +
+

This will also shrink the images considerably (in bytes, not + pixels!). If the option "first" is + given, the first frame of the animation is used as the + replacement. If "last" is given, the + last frame of the animation is used instead, which probably + makes more sense for most banner animations, but also has the + risk of not showing the entire last frame (if it is only a + delta to an earlier frame).

+ +

You can safely use this action with patterns that will also + match non-GIF objects, because no attempt will be made at + anything that doesn't look like a GIF.

+
+ +
Example usage:
+ +
+ + + + +
+
++deanimate-gifs{last}
+
+
+
+
+
+
+ +
+

8.5.13. downgrade-http-version

+ +
+
+
Typical use:
+ +
+

Work around (very rare) problems with HTTP/1.1

+
+ +
Effect:
+ +
+

Downgrades HTTP/1.1 client requests and server replies to + HTTP/1.0.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

This is a left-over from the time when Privoxy didn't support important HTTP/1.1 + features well. It is left here for the unlikely case that you + experience HTTP/1.1-related problems with some server out + there.

+ +

Note that enabling this action is only a workaround. It + should not be enabled for sites that work without it. While it + shouldn't break any pages, it has an (usually negative) + performance impact.

+ +

If you come across a site where enabling this action helps, + please report it, so the cause of the problem can be analyzed. + If the problem turns out to be caused by a bug in Privoxy it should be fixed so the + following release works without the work around.

+
+ +
Example usage (section):
+ +
+ + + + +
+
+{+downgrade-http-version}
+problem-host.example.com
+
+
+
+
+
+
+ +
+

8.5.14. fast-redirects

+ +
+
+
Typical use:
+ +
+

Fool some click-tracking scripts and speed up indirect + links.

+
+ +
Effect:
+ +
+

Detects redirection URLs and redirects the browser without + contacting the redirection server first.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+
    +
  • +

    "simple-check" to just search + for the string "http://" to + detect redirection URLs.

    +
  • + +
  • +

    "check-decoded-url" to decode + URLs (if necessary) before searching for redirection + URLs.

    +
  • +
+
+ +
Notes:
+ +
+

Many sites, like yahoo.com, don't just link to other sites. + Instead, they will link to some script on their own servers, + giving the destination as a parameter, which will then redirect + you to the final target. URLs resulting from this scheme + typically look like: "http://www.example.org/click-tracker.cgi?target=http%3a//www.example.net/".

+ +

Sometimes, there are even multiple consecutive redirects + encoded in the URL. These redirections via scripts make your + web browsing more traceable, since the server from which you + follow such a link can see where you go to. Apart from that, + valuable bandwidth and time is wasted, while your browser asks + the server for one redirect after the other. Plus, it feeds the + advertisers.

+ +

This feature is currently not very smart and is scheduled + for improvement. If it is enabled by default, you will have to + create some exceptions to this action. It can lead to failures + in several ways:

+ +

Not every URLs with other URLs as parameters is evil. Some + sites offer a real service that requires this information to + work. For example a validation service needs to know, which + document to validate. fast-redirects + assumes that every URL parameter that looks like another URL is + a redirection target, and will always redirect to the last one. + Most of the time the assumption is correct, but if it isn't, + the user gets redirected anyway.

+ +

Another failure occurs if the URL contains other parameters + after the URL parameter. The URL: "http://www.example.org/?redirect=http%3a//www.example.net/&foo=bar". + contains the redirection URL "http://www.example.net/", followed by another + parameter. fast-redirects doesn't know + that and will cause a redirect to "http://www.example.net/&foo=bar". Depending + on the target server configuration, the parameter will be + silently ignored or lead to a "page not + found" error. You can prevent this problem by first + using the redirect action to remove + the last part of the URL, but it requires a little effort.

+ +

To detect a redirection URL, fast-redirects only looks for the string + "http://", either in plain text + (invalid but often used) or encoded as "http%3a//". Some sites use their own URL + encoding scheme, encrypt the address of the target server or + replace it with a database id. In theses cases fast-redirects is fooled and the request reaches + the redirection server where it probably gets logged.

+
+ +
Example usage:
+ +
+ + + + +
+
+ { +fast-redirects{simple-check} }
+   one.example.com
+
+ { +fast-redirects{check-decoded-url} }
+   another.example.com/testing
+
+
+
+
+
+
+ +
+

8.5.15. + filter

+ +
+
+
Typical use:
+ +
+

Get rid of HTML and JavaScript annoyances, banner + advertisements (by size), do fun text replacements, add + personalized effects, etc.

+
+ +
Effect:
+ +
+

All instances of text-based type, most notably HTML and + JavaScript, to which this action applies, can be filtered + on-the-fly through the specified regular expression based + substitutions. (Note: as of version 3.0.3 plain text documents + are exempted from filtering, because web servers often use the + text/plain MIME type for all files + whose type they don't know.)

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

The name of a content filter, as defined in the filter file. Filters can be defined in + one or more files as defined by the filterfile + option in the config file. default.filter is the collection of filters + supplied by the developers. Locally defined filters should go + in their own file, such as user.filter.

+ +

When used in its negative form, and without parameters, + all filtering is + completely disabled.

+
+ +
Notes:
+ +
+

For your convenience, there are a number of pre-defined + filters available in the distribution filter file that you can + use. See the examples below for a list.

+ +

Filtering requires buffering the page content, which may + appear to slow down page rendering since nothing is displayed + until all content has passed the filters. (The total time until + the page is completely rendered doesn't change much, but it may + be perceived as slower since the page is not incrementally + displayed.) This effect will be more noticeable on slower + connections.

+ +

"Rolling your own" filters + requires a knowledge of "Regular Expressions" and + "HTML". This is very + powerful feature, and potentially very intrusive. Filters + should be used with caution, and where an equivalent + "action" is not available.

+ +

The amount of data that can be filtered is limited to the + buffer-limit option in the + main config file. The default is 4096 + KB (4 Megs). Once this limit is exceeded, the buffered data, + and all pending data, is passed through unfiltered.

+ +

Inappropriate MIME types, such as zipped files, are not + filtered at all. (Again, only text-based types except plain + text). Encrypted SSL data (from HTTPS servers) cannot be + filtered either, since this would violate the integrity of the + secure transaction. In some situations it might be necessary to + protect certain text, like source code, from filtering by + defining appropriate -filter + exceptions.

+ +

Compressed content can't be filtered either, but if + Privoxy is compiled with zlib + support and a supported compression algorithm is used (gzip or + deflate), Privoxy can first + decompress the content and then filter it.

+ +

If you use a Privoxy + version without zlib support, but want filtering to work on as + much documents as possible, even those that would normally be + sent compressed, you must use the prevent-compression + action in conjunction with filter.

+ +

Content filtering can achieve some of the same effects as + the block action, i.e. it can be + used to block ads and banners. But the mechanism works quite + differently. One effective use, is to block ad banners based on + their size (see below), since many of these seem to be somewhat + standardized.

+ +

Feedback with suggestions for new + or improved filters is particularly welcome!

+ +

The below list has only the names and a one-line description + of each predefined filter. There are more verbose + explanations of what these filters do in the filter file chapter.

+
+ +
Example usage (with filters from the distribution default.filter file). See the Predefined Filters + section for more explanation on each:
+ +
+

+ + + + + +
+
++filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse.
+
+
+ +

+ + + + + +
+
++filter{js-events}           # Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).
+
+
+ +

+ + + + + +
+
++filter{html-annoyances}     # Get rid of particularly annoying HTML abuse.
+
+
+ +

+ + + + + +
+
++filter{content-cookies}     # Kill cookies that come in the HTML or JS content.
+
+
+ +

+ + + + + +
+
++filter{refresh-tags}        # Kill automatic refresh tags (for dial-on-demand setups).
+
+
+ +

+ + + + + +
+
++filter{unsolicited-popups}  # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.
+
+
+ +

+ + + + + +
+
++filter{all-popups}          # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.
+
+
+ +

+ + + + + +
+
++filter{img-reorder}         # Reorder attributes in <img> tags to make the banners-by-* filters more effective.
+
+
+ +

+ + + + + +
+
++filter{banners-by-size}     # Kill banners by size.
+
+
+ +

+ + + + + +
+
++filter{banners-by-link}     # Kill banners by their links to known clicktrackers.
+
+
+ +

+ + + + + +
+
++filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking).
+
+
+ +

+ + + + + +
+
++filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap.
+
+
+ +

+ + + + + +
+
++filter{jumping-windows}     # Prevent windows from resizing and moving themselves.
+
+
+ +

+ + + + + +
+
++filter{frameset-borders}    # Give frames a border and make them resizable.
+
+
+ +

+ + + + + +
+
++filter{demoronizer}         # Fix MS's non-standard use of standard charsets.
+
+
+ +

+ + + + + +
+
++filter{shockwave-flash}     # Kill embedded Shockwave Flash objects.
+
+
+ +

+ + + + + +
+
++filter{quicktime-kioskmode} # Make Quicktime movies saveable.
+
+
+ +

+ + + + + +
+
++filter{fun}                 # Text replacements for subversive browsing fun!
+
+
+ +

+ + + + + +
+
++filter{crude-parental}      # Crude parental filtering. Note that this filter doesn't work reliably.
+
+
+ +

+ + + + + +
+
++filter{ie-exploits}         # Disable some known Internet Explorer bug exploits.
+
+
+ +

+ + + + + +
+
++filter{site-specifics}      # Cure for site-specific problems. Don't apply generally!
+
+
+ +

+ + + + + +
+
++filter{no-ping}             # Removes non-standard ping attributes in <a> and <area> tags.
+
+
+ +

+ + + + + +
+
++filter{google}              # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.
+
+
+ +

+ + + + + +
+
++filter{yahoo}               # CSS-based block for Yahoo text ads. Also removes a width limitation.
+
+
+ +

+ + + + + +
+
++filter{msn}                 # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.
+
+
+ +

+ + + + + +
+
++filter{blogspot}            # Cleans up some Blogspot blogs. Read the fine print before using this.
+
+
+
+
+
+
+ +
+

8.5.16. force-text-mode

+ +
+
+
Typical use:
+ +
+

Force Privoxy to treat a + document as if it was in some kind of text format.

+
+ +
Effect:
+ +
+

Declares a document as text, even if the "Content-Type:" isn't detected as such.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

As explained above, Privoxy tries to only filter files that + are in some kind of text format. The same restrictions apply to + content-type-overwrite. + force-text-mode declares a document as + text, without looking at the "Content-Type:" first.

+ +
+ + + + + + + + +
Warning
+

Think twice before activating this action. Filtering + binary data with regular expressions can cause file + damage.

+
+
+
+ +
Example usage:
+ +
+ + + + +
+
++force-text-mode
+
+
+
+
+
+
+
+ +
+

8.5.17. forward-override

+ +
+
+
Typical use:
+ +
+

Change the forwarding settings based on User-Agent or + request origin

+
+ +
Effect:
+ +
+

Overrules the forward directives in the configuration + file.

+
+ +
Type:
+ +
+

Multi-value.

+
+ +
Parameter:
+ +
+
    +
  • +

    "forward ." to use a direct + connection without any additional proxies.

    +
  • + +
  • +

    "forward 127.0.0.1:8123" to + use the HTTP proxy listening at 127.0.0.1 port 8123.

    +
  • + +
  • +

    "forward-socks4a 127.0.0.1:9050 + ." to use the socks4a proxy listening at 127.0.0.1 + port 9050. Replace "forward-socks4a" with "forward-socks4" to use a socks4 connection + (with local DNS resolution) instead, use "forward-socks5" for socks5 connections + (with remote DNS resolution).

    +
  • + +
  • +

    "forward-socks4a 127.0.0.1:9050 + proxy.example.org:8000" to use the socks4a proxy + listening at 127.0.0.1 port 9050 to reach the HTTP proxy + listening at proxy.example.org port 8000. Replace + "forward-socks4a" with + "forward-socks4" to use a socks4 + connection (with local DNS resolution) instead, use + "forward-socks5" for socks5 + connections (with remote DNS resolution).

    +
  • +
+
+ +
Notes:
+ +
+

This action takes parameters similar to the forward directives in the + configuration file, but without the URL pattern. It can be used + as replacement, but normally it's only used in cases where + matching based on the request URL isn't sufficient.

+ +
+ + + + + + + + +
Warning
+

Please read the description for the forward directives before + using this action. Forwarding to the wrong people will + reduce your privacy and increase the chances of + man-in-the-middle attacks.

+ +

If the ports are missing or invalid, default values + will be used. This might change in the future and you + shouldn't rely on it. Otherwise incorrect syntax causes + Privoxy to exit.

+ +

Use the show-url-info CGI page to verify that your + forward settings do what you thought the do.

+
+
+
+ +
Example usage:
+ +
+ + + + +
+
+# Always use direct connections for requests previously tagged as
+# "User-Agent: fetch libfetch/2.0" and make sure
+# resuming downloads continues to work.
+# This way you can continue to use Tor for your normal browsing,
+# without overloading the Tor network with your FreeBSD ports updates
+# or downloads of bigger files like ISOs.
+# Note that HTTP headers are easy to fake and therefore their
+# values are as (un)trustworthy as your clients and users.
+{+forward-override{forward .} \
+ -hide-if-modified-since      \
+ -overwrite-last-modified     \
+}
+TAG:^User-Agent: fetch libfetch/2\.0$
+
+
+
+
+
+
+
+ +
+

8.5.18. handle-as-empty-document

+ +
+
+
Typical use:
+ +
+

Mark URLs that should be replaced by empty documents + if they get + blocked

+
+ +
Effect:
+ +
+

This action alone doesn't do anything noticeable. It just + marks URLs. If the block action also applies, the presence or + absence of this mark decides whether an HTML "BLOCKED" page, or an empty document will be + sent to the client as a substitute for the blocked content. The + empty document isn't + literally empty, but actually contains a single space.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

Some browsers complain about syntax errors if JavaScript + documents are blocked with Privoxy's default HTML page; this option + can be used to silence them. And of course this action can also + be used to eliminate the Privoxy BLOCKED message in frames.

+ +

The content type for the empty document can be specified + with content-type-overwrite{}, + but usually this isn't necessary.

+
+ +
Example usage:
+ +
+ + + + +
+
+# Block all documents on example.org that end with ".js",
+# but send an empty document instead of the usual HTML message.
+{+block{Blocked JavaScript} +handle-as-empty-document}
+example.org/.*\.js$
+
+
+
+
+
+
+
+ +
+

8.5.19. handle-as-image

+ +
+
+
Typical use:
+ +
+

Mark URLs as belonging to images (so they'll be replaced by + images if they do get + blocked, rather than HTML pages)

+
+ +
Effect:
+ +
+

This action alone doesn't do anything noticeable. It just + marks URLs as images. If the block action also applies, the presence or + absence of this mark decides whether an HTML "blocked" page, or a replacement image (as + determined by the set-image-blocker + action) will be sent to the client as a substitute for the + blocked content.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

The below generic example section is actually part of + default.action. It marks all URLs + with well-known image file name extensions as images and should + be left intact.

+ +

Users will probably only want to use the handle-as-image + action in conjunction with block, to block sources of + banners, whose URLs don't reflect the file type, like in the + second example section.

+ +

Note that you cannot treat HTML pages as images in most + cases. For instance, (in-line) ad frames require an HTML page + to be sent, or they won't display properly. Forcing handle-as-image in this situation will not + replace the ad frame with an image, but lead to error + messages.

+
+ +
Example usage (sections):
+ +
+ + + + +
+
+# Generic image extensions:
+#
+{+handle-as-image}
+/.*\.(gif|jpg|jpeg|png|bmp|ico)$
+
+# These don't look like images, but they're banners and should be
+# blocked as images:
+#
+{+block{Nasty banners.} +handle-as-image}
+nasty-banner-server.example.com/junk.cgi\?output=trash
+
+
+
+
+
+
+ +
+

8.5.20. hide-accept-language

+ +
+
+
Typical use:
+ +
+

Pretend to use different language settings.

+
+ +
Effect:
+ +
+

Deletes or replaces the "Accept-Language:" HTTP header in client + requests.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Keyword: "block", or any user + defined value.

+
+ +
Notes:
+ +
+

Faking the browser's language settings can be useful to make + a foreign User-Agent set with hide-user-agent + more believable.

+ +

However some sites with content in different languages check + the "Accept-Language:" to decide + which one to take by default. Sometimes it isn't possible to + later switch to another language without changing the + "Accept-Language:" header first.

+ +

Therefore it's a good idea to either only change the + "Accept-Language:" header to + languages you understand, or to languages that aren't wide + spread.

+ +

Before setting the "Accept-Language:" header to a rare language, + you should consider that it helps to make your requests unique + and thus easier to trace. If you don't plan to change this + header frequently, you should stick to a common language.

+
+ +
Example usage (section):
+ +
+ + + + +
+
+# Pretend to use Canadian language settings.
+{+hide-accept-language{en-ca} \
++hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
+}
+/
+
+
+
+
+
+
+ +
+

8.5.21. hide-content-disposition

+ +
+
+
Typical use:
+ +
+

Prevent download menus for content you prefer to view inside + the browser.

+
+ +
Effect:
+ +
+

Deletes or replaces the "Content-Disposition:" HTTP header set by some + servers.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Keyword: "block", or any user + defined value.

+
+ +
Notes:
+ +
+

Some servers set the "Content-Disposition:" HTTP header for documents + they assume you want to save locally before viewing them. The + "Content-Disposition:" header + contains the file name the browser is supposed to use by + default.

+ +

In most browsers that understand this header, it makes it + impossible to just + view the document, without downloading it first, even if + it's just a simple text file or an image.

+ +

Removing the "Content-Disposition:" header helps to prevent + this annoyance, but some browsers additionally check the + "Content-Type:" header, before they + decide if they can display a document without saving it first. + In these cases, you have to change this header as well, before + the browser stops displaying download menus.

+ +

It is also possible to change the server's file name + suggestion to another one, but in most cases it isn't worth the + time to set it up.

+ +

This action will probably be removed in the future, use + server-header filters instead.

+
+ +
Example usage:
+ +
+ + + + +
+
+# Disarm the download link in Sourceforge's patch tracker
+{ -filter \
+ +content-type-overwrite{text/plain}\
+ +hide-content-disposition{block} }
+ .sourceforge.net/tracker/download\.php
+
+
+
+
+
+
+ +
+

8.5.22. hide-if-modified-since

+ +
+
+
Typical use:
+ +
+

Prevent yet another way to track the user's steps between + sessions.

+
+ +
Effect:
+ +
+

Deletes the "If-Modified-Since:" + HTTP client header or modifies its value.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Keyword: "block", or a user + defined value that specifies a range of hours.

+
+ +
Notes:
+ +
+

Removing this header is useful for filter testing, where you + want to force a real reload instead of getting status code + "304", which would cause the browser + to use a cached copy of the page.

+ +

Instead of removing the header, hide-if-modified-since can also add or subtract + a random amount of time to/from the header's value. You specify + a range of minutes where the random factor should be chosen + from and Privoxy does the + rest. A negative value means subtracting, a positive value + adding.

+ +

Randomizing the value of the "If-Modified-Since:" makes it less likely that + the server can use the time as a cookie replacement, but you + will run into caching problems if the random range is too + high.

+ +

It is a good idea to only use a small negative value and let + overwrite-last-modified + handle the greater changes.

+ +

It is also recommended to use this action together with + crunch-if-none-match, + otherwise it's more or less pointless.

+
+ +
Example usage (section):
+ +
+ + + + +
+
+# Let the browser revalidate but make tracking based on the time less likely.
+{+hide-if-modified-since{-60} \
+ +overwrite-last-modified{randomize} \
+ +crunch-if-none-match}
+/
+
+
+
+
+
+
+ +
+

8.5.23. hide-from-header

+ +
+
+
Typical use:
+ +
+

Keep your (old and ill) browser from telling web servers + your email address

+
+ +
Effect:
+ +
+

Deletes any existing "From:" HTTP + header, or replaces it with the specified string.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Keyword: "block", or any user + defined value.

+
+ +
Notes:
+ +
+

The keyword "block" will + completely remove the header (not to be confused with the + block action).

+ +

Alternately, you can specify any value you prefer to be sent + to the web server. If you do, it is a matter of fairness not to + use any address that is actually used by a real person.

+ +

This action is rarely needed, as modern web browsers don't + send "From:" headers anymore.

+
+ +
Example usage:
+ +
+ + + + +
+
++hide-from-header{block}
+
+
or + + + + + +
+
++hide-from-header{spam-me-senseless@sittingduck.example.com}
+
+
+
+
+
+
+ +
+

8.5.24. + hide-referrer

+ +
+
+
Typical use:
+ +
+

Conceal which link you followed to get to a particular + site

+
+ +
Effect:
+ +
+

Deletes the "Referer:" (sic) HTTP + header from the client request, or replaces it with a forged + one.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+
    +
  • +

    "conditional-block" to delete + the header completely if the host has changed.

    +
  • + +
  • +

    "conditional-forge" to forge + the header if the host has changed.

    +
  • + +
  • +

    "block" to delete the header + unconditionally.

    +
  • + +
  • +

    "forge" to pretend to be + coming from the homepage of the server we are talking + to.

    +
  • + +
  • +

    Any other string to set a user defined referrer.

    +
  • +
+
+ +
Notes:
+ +
+

conditional-block is the only + parameter, that isn't easily detected in the server's log file. + If it blocks the referrer, the request will look like the + visitor used a bookmark or typed in the address directly.

+ +

Leaving the referrer unmodified for requests on the same + host allows the server owner to see the visitor's "click path", but in most cases she could also + get that information by comparing other parts of the log file: + for example the User-Agent if it isn't a very common one, or + the user's IP address if it doesn't change between different + requests.

+ +

Always blocking the referrer, or using a custom one, can + lead to failures on servers that check the referrer before they + answer any requests, in an attempt to prevent their content + from being embedded or linked to elsewhere.

+ +

Both conditional-block and + forge will work with referrer checks, + as long as content and valid referring page are on the same + host. Most of the time that's the case.

+ +

hide-referer is an alternate + spelling of hide-referrer and the two + can be can be freely substituted with each other. ("referrer" is the correct English spelling, + however the HTTP specification has a bug - it requires it to be + spelled as "referer".)

+
+ +
Example usage:
+ +
+ + + + +
+
++hide-referrer{forge}
+
+
or + + + + + +
+
++hide-referrer{http://www.yahoo.com/}
+
+
+
+
+
+
+ +
+

8.5.25. hide-user-agent

+ +
+
+
Typical use:
+ +
+

Try to conceal your type of browser and client operating + system

+
+ +
Effect:
+ +
+

Replaces the value of the "User-Agent:" HTTP header in client requests + with the specified value.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

Any user-defined string.

+
+ +
Notes:
+ +
+
+ + + + + + + + +
Warning
+

This can lead to problems on web sites that depend + on looking at this header in order to customize their + content for different browsers (which, by the way, is + NOT the right + thing to do: good web sites work + browser-independently).

+
+
+ +

Using this action in multi-user setups or wherever different + types of browsers will access the same Privoxy is not recommended. In single-user, + single-browser setups, you might use it to delete your OS + version information from the headers, because it is an + invitation to exploit known bugs for your OS. It is also + occasionally useful to forge this in order to access sites that + won't let you in otherwise (though there may be a good reason + in some cases).

+ +

More information on known user-agent strings can be found at + http://www.user-agents.org/ and http://en.wikipedia.org/wiki/User_agent.

+
+ +
Example usage:
+ +
+ + + + +
+
++hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}
+
+
+
+
+
+
+ +
+

8.5.26. + limit-connect

+ +
+
+
Typical use:
+ +
+

Prevent abuse of Privoxy as + a TCP proxy relay or disable SSL for untrusted sites

+
+ +
Effect:
+ +
+

Specifies to which ports HTTP CONNECT requests are + allowable.

+
+ +
Type:
- { +fast-redirects{check-decoded-url} } - another.example.com/testing
-

8.5.15. filter

Typical use:

Get rid of HTML and JavaScript annoyances, banner advertisements (by size), - do fun text replacements, add personalized effects, etc.

Effect:

All instances of text-based type, most notably HTML and JavaScript, to which - this action applies, can be filtered on-the-fly through the specified regular - expression based substitutions. (Note: as of version 3.0.3 plain text documents - are exempted from filtering, because web servers often use the - text/plain MIME type for all files whose type they don't know.) -

Type:

Parameterized.

Parameter:

The name of a content filter, as defined in the filter file. - Filters can be defined in one or more files as defined by the - filterfile - option in the config file. - default.filter is the collection of filters - supplied by the developers. Locally defined filters should go - in their own file, such as user.filter. -

When used in its negative form, - and without parameters, all filtering is completely disabled. -

Notes:

For your convenience, there are a number of pre-defined filters available - in the distribution filter file that you can use. See the examples below for - a list. -

Filtering requires buffering the page content, which may appear to - slow down page rendering since nothing is displayed until all content has - passed the filters. (The total time until the page is completely rendered - doesn't change much, but it may be perceived as slower since the page is - not incrementally displayed.) - This effect will be more noticeable on slower connections. -

"Rolling your own" - filters requires a knowledge of - "Regular - Expressions" and - "HTML". - This is very powerful feature, and potentially very intrusive. - Filters should be used with caution, and where an equivalent - "action" is not available. -

The amount of data that can be filtered is limited to the - buffer-limit - option in the main config file. The - default is 4096 KB (4 Megs). Once this limit is exceeded, the buffered - data, and all pending data, is passed through unfiltered. -

Inappropriate MIME types, such as zipped files, are not filtered at all. - (Again, only text-based types except plain text). Encrypted SSL data - (from HTTPS servers) cannot be filtered either, since this would violate - the integrity of the secure transaction. In some situations it might - be necessary to protect certain text, like source code, from filtering - by defining appropriate -filter exceptions. -

Compressed content can't be filtered either, unless Privoxy - is compiled with zlib support (requires at least Privoxy 3.0.7), - in which case Privoxy will decompress the content before filtering - it. -

If you use a Privoxy version without zlib support, but want filtering to work on - as much documents as possible, even those that would normally be sent compressed, - you must use the prevent-compression - action in conjunction with filter. -

Content filtering can achieve some of the same effects as the - block - action, i.e. it can be used to block ads and banners. But the mechanism - works quite differently. One effective use, is to block ad banners - based on their size (see below), since many of these seem to be somewhat - standardized. -

Feedback with suggestions for new or - improved filters is particularly welcome! -

The below list has only the names and a one-line description of each - predefined filter. There are more - verbose explanations of what these filters do in the filter file chapter. -

Example usage (with filters from the distribution default.filter file). - See the Predefined Filters section for - more explanation on each:

-
+filter{js-annoyances}       # Get rid of particularly annoying JavaScript abuse.
-

-
+filter{js-events}           # Kill all JS event bindings and timers (Radically destructive! Only for extra nasty sites).
-

-
+filter{html-annoyances}     # Get rid of particularly annoying HTML abuse.
-

-
+filter{content-cookies}     # Kill cookies that come in the HTML or JS content.
-

-
+filter{refresh-tags}        # Kill automatic refresh tags (for dial-on-demand setups).
-

-
+filter{unsolicited-popups}  # Disable only unsolicited pop-up windows. Useful if your browser lacks this ability.
-

-
+filter{all-popups}          # Kill all popups in JavaScript and HTML. Useful if your browser lacks this ability.
-

-
+filter{img-reorder}         # Reorder attributes in <img> tags to make the banners-by-* filters more effective.
-

-
+filter{banners-by-size}     # Kill banners by size.
-

-
+filter{banners-by-link}     # Kill banners by their links to known clicktrackers.
-

-
+filter{webbugs}             # Squish WebBugs (1x1 invisible GIFs used for user tracking).
-

-
+filter{tiny-textforms}      # Extend those tiny textareas up to 40x80 and kill the hard wrap.
-

-
+filter{jumping-windows}     # Prevent windows from resizing and moving themselves.
-

-
+filter{frameset-borders}    # Give frames a border and make them resizable.
-

-
+filter{demoronizer}         # Fix MS's non-standard use of standard charsets.
-

-
+filter{shockwave-flash}     # Kill embedded Shockwave Flash objects.
-

-
+filter{quicktime-kioskmode} # Make Quicktime movies saveable.
-

-
+filter{fun}                 # Text replacements for subversive browsing fun!
-

-
+filter{crude-parental}      # Crude parental filtering. Note that this filter doesn't work reliably.
-

-
+filter{ie-exploits}         # Disable some known Internet Explorer bug exploits.
-

-
+filter{site-specifics}      # Cure for site-specific problems. Don't apply generally!
-

-
+filter{no-ping}             # Removes non-standard ping attributes in <a> and <area> tags.
-

-
+filter{google}              # CSS-based block for Google text ads. Also removes a width limitation and the toolbar advertisement.
-

-
+filter{yahoo}               # CSS-based block for Yahoo text ads. Also removes a width limitation.
-

-
+filter{msn}                 # CSS-based block for MSN text ads. Also removes tracking URLs and a width limitation.
-

-
+filter{blogspot}            # Cleans up some Blogspot blogs. Read the fine print before using this.
-

8.5.16. force-text-mode

Typical use:

Force Privoxy to treat a document as if it was in some kind of text format.

Effect:

Declares a document as text, even if the "Content-Type:" isn't detected as such. -

Type:

Boolean.

Parameter:

N/A -

Notes:

As explained above, - Privoxy tries to only filter files that are - in some kind of text format. The same restrictions apply to - content-type-overwrite. - force-text-mode declares a document as text, - without looking at the "Content-Type:" first. -

Warning

Think twice before activating this action. Filtering binary data - with regular expressions can cause file damage. -

Example usage:

+force-text-mode
-     
-

8.5.17. forward-override

Typical use:

Change the forwarding settings based on User-Agent or request origin

Effect:

Overrules the forward directives in the configuration file. -

Type:

Multi-value.

Parameter:

  • "forward ." to use a direct connection without any additional proxies.

  • "forward 127.0.0.1:8123" to use the HTTP proxy listening at 127.0.0.1 port 8123. -

  • "forward-socks4a 127.0.0.1:9050 ." to use the socks4a proxy listening at - 127.0.0.1 port 9050. Replace "forward-socks4a" with "forward-socks4" - to use a socks4 connection (with local DNS resolution) instead, use "forward-socks5" - for socks5 connections (with remote DNS resolution). -

  • "forward-socks4a 127.0.0.1:9050 proxy.example.org:8000" to use the socks4a proxy - listening at 127.0.0.1 port 9050 to reach the HTTP proxy listening at proxy.example.org port 8000. - Replace "forward-socks4a" with "forward-socks4" to use a socks4 connection - (with local DNS resolution) instead, use "forward-socks5" - for socks5 connections (with remote DNS resolution). -

Notes:

This action takes parameters similar to the - forward directives in the configuration - file, but without the URL pattern. It can be used as replacement, but normally it's only - used in cases where matching based on the request URL isn't sufficient. -

Warning

Please read the description for the forward directives before - using this action. Forwarding to the wrong people will reduce your privacy and increase the - chances of man-in-the-middle attacks. -

If the ports are missing or invalid, default values will be used. This might change - in the future and you shouldn't rely on it. Otherwise incorrect syntax causes Privoxy - to exit. -

Use the show-url-info CGI page - to verify that your forward settings do what you thought the do. -

Example usage:

# Always use direct connections for requests previously tagged as
-# "User-Agent: fetch libfetch/2.0" and make sure
-# resuming downloads continues to work.
-# This way you can continue to use Tor for your normal browsing,
-# without overloading the Tor network with your FreeBSD ports updates
-# or downloads of bigger files like ISOs.
-# Note that HTTP headers are easy to fake and therefore their
-# values are as (un)trustworthy as your clients and users.
-{+forward-override{forward .} \
- -hide-if-modified-since      \
- -overwrite-last-modified     \
-}
-TAG:^User-Agent: fetch libfetch/2\.0$
-     
-

8.5.18. handle-as-empty-document

Typical use:

Mark URLs that should be replaced by empty documents if they get blocked

Effect:

This action alone doesn't do anything noticeable. It just marks URLs. - If the block action also applies, - the presence or absence of this mark decides whether an HTML "BLOCKED" - page, or an empty document will be sent to the client as a substitute for the blocked content. - The empty document isn't literally empty, but actually contains a single space. -

Type:

Boolean.

Parameter:

N/A -

Notes:

Some browsers complain about syntax errors if JavaScript documents - are blocked with Privoxy's - default HTML page; this option can be used to silence them. - And of course this action can also be used to eliminate the Privoxy - BLOCKED message in frames. -

The content type for the empty document can be specified with - content-type-overwrite{}, - but usually this isn't necessary. -

Example usage:

# Block all documents on example.org that end with ".js",
-# but send an empty document instead of the usual HTML message. 
-{+block{Blocked JavaScript} +handle-as-empty-document}
-example.org/.*\.js$
-     
-

8.5.19. handle-as-image

Typical use:

Mark URLs as belonging to images (so they'll be replaced by images if they do get blocked, rather than HTML pages)

Effect:

This action alone doesn't do anything noticeable. It just marks URLs as images. - If the block action also applies, - the presence or absence of this mark decides whether an HTML "blocked" - page, or a replacement image (as determined by the set-image-blocker action) will be sent to the - client as a substitute for the blocked content. -

Type:

Boolean.

Parameter:

N/A -

Notes:

The below generic example section is actually part of default.action. - It marks all URLs with well-known image file name extensions as images and should - be left intact. -

Users will probably only want to use the handle-as-image action in conjunction with - block, to block sources of banners, whose URLs don't - reflect the file type, like in the second example section. -

Note that you cannot treat HTML pages as images in most cases. For instance, (in-line) ad - frames require an HTML page to be sent, or they won't display properly. - Forcing handle-as-image in this situation will not replace the - ad frame with an image, but lead to error messages. -

Example usage (sections):

# Generic image extensions:
-#
-{+handle-as-image}
-/.*\.(gif|jpg|jpeg|png|bmp|ico)$
+            
+

Parameterized.

+
-# These don't look like images, but they're banners and should be -# blocked as images: -# -{+block{Nasty banners.} +handle-as-image} -nasty-banner-server.example.com/junk.cgi\?output=trash
-

8.5.20. hide-accept-language

Typical use:

Pretend to use different language settings.

Effect:

Deletes or replaces the "Accept-Language:" HTTP header in client requests. -

Type:

Parameterized.

Parameter:

Keyword: "block", or any user defined value. -

Notes:

Faking the browser's language settings can be useful to make a - foreign User-Agent set with - hide-user-agent - more believable. -

However some sites with content in different languages check the - "Accept-Language:" to decide which one to take by default. - Sometimes it isn't possible to later switch to another language without - changing the "Accept-Language:" header first. -

Therefore it's a good idea to either only change the - "Accept-Language:" header to languages you understand, - or to languages that aren't wide spread. -

Before setting the "Accept-Language:" header - to a rare language, you should consider that it helps to - make your requests unique and thus easier to trace. - If you don't plan to change this header frequently, - you should stick to a common language. -

Example usage (section):

# Pretend to use Canadian language settings.
-{+hide-accept-language{en-ca} \
-+hide-user-agent{Mozilla/5.0 (X11; U; OpenBSD i386; en-CA; rv:1.8.0.4) Gecko/20060628 Firefox/1.5.0.4} \
-}
-/   
-

8.5.21. hide-content-disposition

Typical use:

Prevent download menus for content you prefer to view inside the browser.

Effect:

Deletes or replaces the "Content-Disposition:" HTTP header set by some servers. -

Type:

Parameterized.

Parameter:

Keyword: "block", or any user defined value. -

Notes:

Some servers set the "Content-Disposition:" HTTP header for - documents they assume you want to save locally before viewing them. - The "Content-Disposition:" header contains the file name - the browser is supposed to use by default. -

In most browsers that understand this header, it makes it impossible to - just view the document, without downloading it first, - even if it's just a simple text file or an image. -

Removing the "Content-Disposition:" header helps - to prevent this annoyance, but some browsers additionally check the - "Content-Type:" header, before they decide if they can - display a document without saving it first. In these cases, you have - to change this header as well, before the browser stops displaying - download menus. -

It is also possible to change the server's file name suggestion - to another one, but in most cases it isn't worth the time to set - it up. -

This action will probably be removed in the future, - use server-header filters instead. -

Example usage:

# Disarm the download link in Sourceforge's patch tracker
-{ -filter \
- +content-type-overwrite{text/plain}\
- +hide-content-disposition{block} }
- .sourceforge.net/tracker/download\.php
-

8.5.22. hide-if-modified-since

Typical use:

Prevent yet another way to track the user's steps between sessions.

Effect:

Deletes the "If-Modified-Since:" HTTP client header or modifies its value. -

Type:

Parameterized.

Parameter:

Keyword: "block", or a user defined value that specifies a range of hours. -

Notes:

Removing this header is useful for filter testing, where you want to force a real - reload instead of getting status code "304", which would cause the - browser to use a cached copy of the page. -

Instead of removing the header, hide-if-modified-since can - also add or subtract a random amount of time to/from the header's value. - You specify a range of minutes where the random factor should be chosen from and - Privoxy does the rest. A negative value means - subtracting, a positive value adding. -

Randomizing the value of the "If-Modified-Since:" makes - it less likely that the server can use the time as a cookie replacement, - but you will run into caching problems if the random range is too high. -

It is a good idea to only use a small negative value and let - overwrite-last-modified - handle the greater changes. -

It is also recommended to use this action together with - crunch-if-none-match, - otherwise it's more or less pointless. -

Example usage (section):

# Let the browser revalidate but make tracking based on the time less likely.
-{+hide-if-modified-since{-60} \
- +overwrite-last-modified{randomize} \
- +crunch-if-none-match}
-/
-

8.5.23. hide-from-header

Typical use:

Keep your (old and ill) browser from telling web servers your email address

Effect:

Deletes any existing "From:" HTTP header, or replaces it with the - specified string. -

Type:

Parameterized.

Parameter:

Keyword: "block", or any user defined value. -

Notes:

The keyword "block" will completely remove the header - (not to be confused with the block - action). -

Alternately, you can specify any value you prefer to be sent to the web - server. If you do, it is a matter of fairness not to use any address that - is actually used by a real person. -

This action is rarely needed, as modern web browsers don't send - "From:" headers anymore. -

Example usage:

+hide-from-header{block}
or -
+hide-from-header{spam-me-senseless@sittingduck.example.com}
-

8.5.24. hide-referrer

Typical use:

Conceal which link you followed to get to a particular site

Effect:

Deletes the "Referer:" (sic) HTTP header from the client request, - or replaces it with a forged one. -

Type:

Parameterized.

Parameter:

  • "conditional-block" to delete the header completely if the host has changed.

  • "conditional-forge" to forge the header if the host has changed.

  • "block" to delete the header unconditionally.

  • "forge" to pretend to be coming from the homepage of the server we are talking to.

  • Any other string to set a user defined referrer.

Notes:

conditional-block is the only parameter, - that isn't easily detected in the server's log file. If it blocks the - referrer, the request will look like the visitor used a bookmark or - typed in the address directly. -

Leaving the referrer unmodified for requests on the same host - allows the server owner to see the visitor's "click path", - but in most cases she could also get that information by comparing - other parts of the log file: for example the User-Agent if it isn't - a very common one, or the user's IP address if it doesn't change between - different requests. -

Always blocking the referrer, or using a custom one, can lead to - failures on servers that check the referrer before they answer any - requests, in an attempt to prevent their content from being - embedded or linked to elsewhere. -

Both conditional-block and forge - will work with referrer checks, as long as content and valid referring page - are on the same host. Most of the time that's the case. -

- hide-referer is an alternate spelling of - hide-referrer and the two can be can be freely - substituted with each other. ("referrer" is the - correct English spelling, however the HTTP specification has a bug - it - requires it to be spelled as "referer".) -

Example usage:

+hide-referrer{forge}
or -
+hide-referrer{http://www.yahoo.com/}
-

8.5.25. hide-user-agent

Typical use:

Try to conceal your type of browser and client operating system

Effect:

Replaces the value of the "User-Agent:" HTTP header - in client requests with the specified value. -

Type:

Parameterized.

Parameter:

Any user-defined string. -

Notes:

Warning

This can lead to problems on web sites that depend on looking at this header in - order to customize their content for different browsers (which, by the - way, is NOT the right thing to do: good web sites - work browser-independently). -

Using this action in multi-user setups or wherever different types of - browsers will access the same Privoxy is - not recommended. In single-user, single-browser - setups, you might use it to delete your OS version information from - the headers, because it is an invitation to exploit known bugs for your - OS. It is also occasionally useful to forge this in order to access - sites that won't let you in otherwise (though there may be a good - reason in some cases). Example of this: some MSN sites will not - let Mozilla enter, yet forging to a - Netscape 6.1 user-agent works just fine. - (Must be just a silly MS goof, I'm sure :-). -

More information on known user-agent strings can be found at - http://www.user-agents.org/ - and - http://en.wikipedia.org/wiki/User_agent. -

Example usage:

+hide-user-agent{Netscape 6.1 (X11; I; Linux 2.4.18 i686)}
-

8.5.26. limit-connect

Typical use:

Prevent abuse of Privoxy as a TCP proxy relay or disable SSL for untrusted sites

Effect:

Specifies to which ports HTTP CONNECT requests are allowable. -

Type:

Parameterized.

Parameter:

A comma-separated list of ports or port ranges (the latter using dashes, with the minimum - defaulting to 0 and the maximum to 65K). -

Notes:

By default, i.e. if no limit-connect action applies, - Privoxy allows HTTP CONNECT requests to all - ports. Use limit-connect if fine-grained control - is desired for some or all destinations. -

The CONNECT methods exists in HTTP to allow access to secure websites - ("https://" URLs) through proxies. It works very simply: - the proxy connects to the server on the specified port, and then - short-circuits its connections to the client and to the remote server. - This means CONNECT-enabled proxies can be used as TCP relays very easily. -

Privoxy relays HTTPS traffic without seeing - the decoded content. Websites can leverage this limitation to circumvent Privoxy's - filters. By specifying an invalid port range you can disable HTTPS entirely. -

Example usages:

+ +
+limit-connect{443}                   # Port 443 is OK.
+            
Parameter:
+ +
+

A comma-separated list of ports or port ranges (the latter + using dashes, with the minimum defaulting to 0 and the maximum + to 65K).

+
+ +
Notes:
+ +
+

By default, i.e. if no limit-connect action applies, Privoxy allows HTTP CONNECT requests to + all ports. Use limit-connect if + fine-grained control is desired for some or all + destinations.

+ +

The CONNECT methods exists in HTTP to allow access to secure + websites ("https://" URLs) through + proxies. It works very simply: the proxy connects to the server + on the specified port, and then short-circuits its connections + to the client and to the remote server. This means + CONNECT-enabled proxies can be used as TCP relays very + easily.

+ +

Privoxy relays HTTPS + traffic without seeing the decoded content. Websites can + leverage this limitation to circumvent Privoxy's filters. By specifying an + invalid port range you can disable HTTPS entirely.

+
+ +
Example usages:
+ +
+ + +
+
++limit-connect{443}                   # Port 443 is OK.
 +limit-connect{80,443}                # Ports 80 and 443 are OK.
 +limit-connect{-3, 7, 20-100, 500-}   # Ports less than 3, 7, 20 to 100 and above 500 are OK.
 +limit-connect{-}                     # All ports are OK
-+limit-connect{,}                     # No HTTPS/SSL traffic is allowed
-

8.5.27. prevent-compression

Typical use:

Ensure that servers send the content uncompressed, so it can be - passed through filters. -

Effect:

Removes the Accept-Encoding header which can be used to ask for compressed transfer. -

Type:

Boolean.

Parameter:

N/A -

Notes:

More and more websites send their content compressed by default, which - is generally a good idea and saves bandwidth. But the filter and - deanimate-gifs - actions need access to the uncompressed data. -

When compiled with zlib support (available since Privoxy 3.0.7), content that should be - filtered is decompressed on-the-fly and you don't have to worry about this action. - If you are using an older Privoxy version, or one that hasn't been compiled with zlib - support, this action can be used to convince the server to send the content uncompressed. -

Most text-based instances compress very well, the size is seldom decreased by less than 50%, - for markup-heavy instances like news feeds saving more than 90% of the original size isn't - unusual. -

Not using compression will therefore slow down the transfer, and you should only - enable this action if you really need it. As of Privoxy 3.0.7 it's disabled in all - predefined action settings. -

Note that some (rare) ill-configured sites don't handle requests for uncompressed - documents correctly. Broken PHP applications tend to send an empty document body, - some IIS versions only send the beginning of the content. If you enable - prevent-compression per default, you might want to add - exceptions for those sites. See the example for how to do that. -

Example usage (sections):

+ +
# Selectively turn off compression, and enable a filter
++limit-connect{,}                     # No HTTPS/SSL traffic is allowed
+
+
+

+
+
+
+ +
+

8.5.27. prevent-compression

+ +
+
+
Typical use:
+ +
+

Ensure that servers send the content uncompressed, so it can + be passed through filters.

+
+ +
Effect:
+ +
+

Removes the Accept-Encoding header which can be used to ask + for compressed transfer.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

More and more websites send their content compressed by + default, which is generally a good idea and saves bandwidth. + But the filter and deanimate-gifs + actions need access to the uncompressed data.

+ +

When compiled with zlib support (available since + Privoxy 3.0.7), content that + should be filtered is decompressed on-the-fly and you don't + have to worry about this action. If you are using an older + Privoxy version, or one that + hasn't been compiled with zlib support, this action can be used + to convince the server to send the content uncompressed.

+ +

Most text-based instances compress very well, the size is + seldom decreased by less than 50%, for markup-heavy instances + like news feeds saving more than 90% of the original size isn't + unusual.

+ +

Not using compression will therefore slow down the transfer, + and you should only enable this action if you really need it. + As of Privoxy 3.0.7 it's + disabled in all predefined action settings.

+ +

Note that some (rare) ill-configured sites don't handle + requests for uncompressed documents correctly. Broken PHP + applications tend to send an empty document body, some IIS + versions only send the beginning of the content. If you enable + prevent-compression per default, you + might want to add exceptions for those sites. See the example + for how to do that.

+
+ +
Example usage (sections):
+ +
+ + +
+
+# Selectively turn off compression, and enable a filter
 #
 { +filter{tiny-textforms} +prevent-compression }
 # Match only these sites
@@ -5797,1076 +3640,653 @@
 # Then maybe make exceptions for broken sites:
 #
 { -prevent-compression }
-.compusa.com/
-

8.5.28. overwrite-last-modified

Typical use:

Prevent yet another way to track the user's steps between sessions.

Effect:

Deletes the "Last-Modified:" HTTP server header or modifies its value. -

Type:

Parameterized.

Parameter:

One of the keywords: "block", "reset-to-request-time" - and "randomize" -

Notes:

Removing the "Last-Modified:" header is useful for filter - testing, where you want to force a real reload instead of getting status - code "304", which would cause the browser to reuse the old - version of the page. -

The "randomize" option overwrites the value of the - "Last-Modified:" header with a randomly chosen time - between the original value and the current time. In theory the server - could send each document with a different "Last-Modified:" - header to track visits without using cookies. "Randomize" - makes it impossible and the browser can still revalidate cached documents. -

"reset-to-request-time" overwrites the value of the - "Last-Modified:" header with the current time. You could use - this option together with - hide-if-modified-since - to further customize your random range. -

The preferred parameter here is "randomize". It is safe - to use, as long as the time settings are more or less correct. - If the server sets the "Last-Modified:" header to the time - of the request, the random range becomes zero and the value stays the same. - Therefore you should later randomize it a second time with - hided-if-modified-since, - just to be sure. -

It is also recommended to use this action together with - crunch-if-none-match. -

Example usage:

+ +
# Let the browser revalidate without being tracked across sessions
+.compusa.com/
+
+
+

+
+
+
+ +
+

8.5.28. overwrite-last-modified

+ +
+
+
Typical use:
+ +
+

Prevent yet another way to track the user's steps between + sessions.

+
+ +
Effect:
+ +
+

Deletes the "Last-Modified:" HTTP + server header or modifies its value.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

One of the keywords: "block", + "reset-to-request-time" and + "randomize"

+
+ +
Notes:
+ +
+

Removing the "Last-Modified:" + header is useful for filter testing, where you want to force a + real reload instead of getting status code "304", which would cause the browser to reuse + the old version of the page.

+ +

The "randomize" option overwrites + the value of the "Last-Modified:" + header with a randomly chosen time between the original value + and the current time. In theory the server could send each + document with a different "Last-Modified:" header to track visits without + using cookies. "Randomize" makes it + impossible and the browser can still revalidate cached + documents.

+ +

"reset-to-request-time" + overwrites the value of the "Last-Modified:" header with the current time. + You could use this option together with hide-if-modified-since + to further customize your random range.

+ +

The preferred parameter here is "randomize". It is safe to use, as long as the + time settings are more or less correct. If the server sets the + "Last-Modified:" header to the time + of the request, the random range becomes zero and the value + stays the same. Therefore you should later randomize it a + second time with hided-if-modified-since, + just to be sure.

+ +

It is also recommended to use this action together with + crunch-if-none-match.

+
+ +
Example usage:
+ +
+ + +
+
+# Let the browser revalidate without being tracked across sessions
 { +hide-if-modified-since{-60} \
  +overwrite-last-modified{randomize} \
  +crunch-if-none-match}
-/
-

8.5.29. redirect

Typical use:

Redirect requests to other sites. -

Effect:

Convinces the browser that the requested document has been moved - to another location and the browser should get it from there. -

Type:

Parameterized

Parameter:

An absolute URL or a single pcrs command. -

Notes:

Requests to which this action applies are answered with a - HTTP redirect to URLs of your choosing. The new URL is - either provided as parameter, or derived by applying a - single pcrs command to the original URL. -

This action will be ignored if you use it together with - block. - It can be combined with - fast-redirects{check-decoded-url} - to redirect to a decoded version of a rewritten URL. -

Use this action carefully, make sure not to create redirection loops - and be aware that using your own redirects might make it - possible to fingerprint your requests. -

In case of problems with your redirects, or simply to watch - them working, enable debug 128. -

Example usages:

+ +
# Replace example.com's style sheet with another one
+/
+
+
+

+
+
+
+ +
+

8.5.29. + redirect

+ +
+
+
Typical use:
+ +
+

Redirect requests to other sites.

+
+ +
Effect:
+ +
+

Convinces the browser that the requested document has been + moved to another location and the browser should get it from + there.

+
+ +
Type:
+ +
+

Parameterized

+
+ +
Parameter:
+ +
+

An absolute URL or a single pcrs command.

+
+ +
Notes:
+ +
+

Requests to which this action applies are answered with a + HTTP redirect to URLs of your choosing. The new URL is either + provided as parameter, or derived by applying a single pcrs + command to the original URL.

+ +

This action will be ignored if you use it together with + block. It can be combined + with fast-redirects{check-decoded-url} + to redirect to a decoded version of a rewritten URL.

+ +

Use this action carefully, make sure not to create + redirection loops and be aware that using your own redirects + might make it possible to fingerprint your requests.

+ +

In case of problems with your redirects, or simply to watch + them working, enable debug + 128.

+
+ +
Example usages:
+ +
+ + +
+
+# Replace example.com's style sheet with another one
 { +redirect{http://localhost/css-replacements/example.com.css} }
  example.com/stylesheet\.css
 
 # Create a short, easy to remember nickname for a favorite site
-# (relies on the browser accept and forward invalid URLs to Privoxy)
+# (relies on the browser accept and forward invalid URLs to Privoxy)
 { +redirect{http://www.privoxy.org/user-manual/actions-file.html} }
  a
 
 # Always use the expanded view for Undeadly.org articles
 # (Note the $ at the end of the URL pattern to make sure
 # the request for the rewritten URL isn't redirected as well)
-{+redirect{s@$@&mode=expanded@}}
-undeadly.org/cgi\?action=article&sid=\d*$
+{+redirect{s@$@&mode=expanded@}}
+undeadly.org/cgi\?action=article&sid=\d*$
 
 # Redirect Google search requests to MSN
-{+redirect{s@^http://[^/]*/search\?q=([^&]*).*@http://search.msn.com/results.aspx?q=$1@}}
+{+redirect{s@^http://[^/]*/search\?q=([^&]*).*@http://search.msn.com/results.aspx?q=$1@}}
 .google.com/search
 
 # Redirect MSN search requests to Yahoo
-{+redirect{s@^http://[^/]*/results\.aspx\?q=([^&]*).*@http://search.yahoo.com/search?p=$1@}}
+{+redirect{s@^http://[^/]*/results\.aspx\?q=([^&]*).*@http://search.yahoo.com/search?p=$1@}}
 search.msn.com//results\.aspx\?q=
 
 # Redirect remote requests for this manual
 # to the local version delivered by Privoxy
 {+redirect{s@^http://www@http://config@}}
-www.privoxy.org/user-manual/
-

8.5.30. server-header-filter

Typical use:

Rewrite or remove single server headers. -

Effect:

All server headers to which this action applies are filtered on-the-fly - through the specified regular expression based substitutions. -

Type:

Parameterized.

Parameter:

The name of a server-header filter, as defined in one of the - filter files. -

Notes:

Server-header filters are applied to each header on its own, not to - all at once. This makes it easier to diagnose problems, but on the downside - you can't write filters that only change header x if header y's value is z. - You can do that by using tags though. -

Server-header filters are executed after the other header actions have finished - and use their output as input. -

Please refer to the filter file chapter - to learn which server-header filters are available by default, and how to - create your own. -

Example usage (section):

+ +
{+server-header-filter{html-to-xml}}
+www.privoxy.org/user-manual/
+
+
+

+
+
+
+ +
+

8.5.30. server-header-filter

+ +
+
+
Typical use:
+ +
+

Rewrite or remove single server headers.

+
+ +
Effect:
+ +
+

All server headers to which this action applies are filtered + on-the-fly through the specified regular expression based + substitutions.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

The name of a server-header filter, as defined in one of the + filter files.

+
+ +
Notes:
+ +
+

Server-header filters are applied to each header on its own, + not to all at once. This makes it easier to diagnose problems, + but on the downside you can't write filters that only change + header x if header y's value is z. You can do that by using + tags though.

+ +

Server-header filters are executed after the other header + actions have finished and use their output as input.

+ +

Please refer to the filter file + chapter to learn which server-header filters are available + by default, and how to create your own.

+
+ +
Example usage (section):
+ +
+ + +
+
+{+server-header-filter{html-to-xml}}
 example.org/xml-instance-that-is-delivered-as-html
 
 {+server-header-filter{xml-to-html}}
 example.org/instance-that-is-delivered-as-xml-but-is-not
-    
-

8.5.31. server-header-tagger

Typical use:

Enable or disable filters based on the Content-Type header. -

Effect:

Server headers to which this action applies are filtered on-the-fly through - the specified regular expression based substitutions, the result is used as - tag. -

Type:

Parameterized.

Parameter:

The name of a server-header tagger, as defined in one of the - filter files. -

Notes:

Server-header taggers are applied to each header on its own, - and as the header isn't modified, each tagger "sees" - the original. -

Server-header taggers are executed before all other header actions - that modify server headers. Their tags can be used to control - all of the other server-header actions, the content filters - and the crunch actions (redirect - and block). -

Obviously crunching based on tags created by server-header taggers - doesn't prevent the request from showing up in the server's log file. -

Example usage (section):

+ +
# Tag every request with the content type declared by the server
+
+
+
+

+
+
+
+ +
+

8.5.31. server-header-tagger

+ +
+
+
Typical use:
+ +
+

Enable or disable filters based on the Content-Type + header.

+
+ +
Effect:
+ +
+

Server headers to which this action applies are filtered + on-the-fly through the specified regular expression based + substitutions, the result is used as tag.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+

The name of a server-header tagger, as defined in one of the + filter files.

+
+ +
Notes:
+ +
+

Server-header taggers are applied to each header on its own, + and as the header isn't modified, each tagger "sees" the original.

+ +

Server-header taggers are executed before all other header + actions that modify server headers. Their tags can be used to + control all of the other server-header actions, the content + filters and the crunch actions (redirect and block).

+ +

Obviously crunching based on tags created by server-header + taggers doesn't prevent the request from showing up in the + server's log file.

+
+ +
Example usage (section):
+ +
+ + +
+
+# Tag every request with the content type declared by the server
 {+server-header-tagger{content-type}}
 /
-    
-

8.5.32. session-cookies-only

Typical use:

Allow only temporary "session" cookies (for the current - browser session only). -

Effect:

Deletes the "expires" field from "Set-Cookie:" - server headers. Most browsers will not store such cookies permanently and - forget them in between sessions. -

Type:

Boolean.

Parameter:

N/A -

Notes:

This is less strict than crunch-incoming-cookies / - crunch-outgoing-cookies and allows you to browse - websites that insist or rely on setting cookies, without compromising your privacy too badly. -

Most browsers will not permanently store cookies that have been processed by - session-cookies-only and will forget about them between sessions. - This makes profiling cookies useless, but won't break sites which require cookies so - that you can log in for transactions. This is generally turned on for all - sites, and is the recommended setting. -

It makes no sense at all to use session-cookies-only - together with crunch-incoming-cookies or - crunch-outgoing-cookies. If you do, cookies - will be plainly killed. -

Note that it is up to the browser how it handles such cookies without an "expires" - field. If you use an exotic browser, you might want to try it out to be sure. -

This setting also has no effect on cookies that may have been stored - previously by the browser before starting Privoxy. - These would have to be removed manually. -

Privoxy also uses - the content-cookies filter - to block some types of cookies. Content cookies are not effected by - session-cookies-only. -

Example usage:

+session-cookies-only
-

8.5.33. set-image-blocker

Typical use:

Choose the replacement for blocked images

Effect:

This action alone doesn't do anything noticeable. If both - block and handle-as-image also - apply, i.e. if the request is to be blocked as an image, - then the parameter of this action decides what will be - sent as a replacement. -

Type:

Parameterized.

Parameter:

  • "pattern" to send a built-in checkerboard pattern image. The image is visually - decent, scales very well, and makes it obvious where banners were busted. -

  • "blank" to send a built-in transparent image. This makes banners disappear - completely, but makes it hard to detect where Privoxy has blocked - images on a given page and complicates troubleshooting if Privoxy - has blocked innocent images, like navigation icons. -

  • "target-url" to - send a redirect to target-url. You can redirect - to any image anywhere, even in your local filesystem via "file:///" URL. - (But note that not all browsers support redirecting to a local file system). -

    A good application of redirects is to use special Privoxy-built-in - URLs, which send the built-in images, as target-url. - This has the same visual effect as specifying "blank" or "pattern" in - the first place, but enables your browser to cache the replacement image, instead of requesting - it over and over again. -

Notes:

The URLs for the built-in images are "http://config.privoxy.org/send-banner?type=type", where type is - either "blank" or "pattern". -

There is a third (advanced) type, called "auto". It is NOT to be - used in set-image-blocker, but meant for use from filters. - Auto will select the type of image that would have applied to the referring page, had it been an image. -

Example usage:

Built-in pattern: -

+set-image-blocker{pattern}
-

Redirect to the BSD daemon: -

+set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}
-

Redirect to the built-in pattern for better caching: -

+set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}
-

8.5.34. Summary

Note that many of these actions have the potential to cause a page to - misbehave, possibly even not to display at all. There are many ways - a site designer may choose to design his site, and what HTTP header - content, and other criteria, he may depend on. There is no way to have hard - and fast rules for all sites. See the Appendix for a brief example on troubleshooting - actions.

8.6. Aliases

Custom "actions", known to Privoxy - as "aliases", can be defined by combining other actions. - These can in turn be invoked just like the built-in actions. - Currently, an alias name can contain any character except space, tab, - "=", - "{" and "}", but we strongly - recommend that you only use "a" to "z", - "0" to "9", "+", and "-". - Alias names are not case sensitive, and are not required to start with a - "+" or "-" sign, since they are merely textually - expanded.

Aliases can be used throughout the actions file, but they must be - defined in a special section at the top of the file! - And there can only be one such section per actions file. Each actions file may - have its own alias section, and the aliases defined in it are only visible - within that file.

There are two main reasons to use aliases: One is to save typing for frequently - used combinations of actions, the other one is a gain in flexibility: If you - decide once how you want to handle shops by defining an alias called - "shop", you can later change your policy on shops in - one place, and your changes will take effect everywhere - in the actions file where the "shop" alias is used. Calling aliases - by their purpose also makes your actions files more readable.

Currently, there is one big drawback to using aliases, though: - Privoxy's built-in web-based action file - editor honors aliases when reading the actions files, but it expands - them before writing. So the effects of your aliases are of course preserved, - but the aliases themselves are lost when you edit sections that use aliases - with it.

Now let's define some aliases...

+ +
 # Useful custom aliases we can use later.
+
+
+
+ + +

+ + +
+

8.5.32. session-cookies-only

+ +
+
+
Typical use:
+ +
+

Allow only temporary "session" + cookies (for the current browser session only).

+
+ +
Effect:
+ +
+

Deletes the "expires" field from + "Set-Cookie:" server headers. Most + browsers will not store such cookies permanently and forget + them in between sessions.

+
+ +
Type:
+ +
+

Boolean.

+
+ +
Parameter:
+ +
+

N/A

+
+ +
Notes:
+ +
+

This is less strict than crunch-incoming-cookies + / crunch-outgoing-cookies + and allows you to browse websites that insist or rely on + setting cookies, without compromising your privacy too + badly.

+ +

Most browsers will not permanently store cookies that have + been processed by session-cookies-only + and will forget about them between sessions. This makes + profiling cookies useless, but won't break sites which require + cookies so that you can log in for transactions. This is + generally turned on for all sites, and is the recommended + setting.

+ +

It makes no sense at + all to use session-cookies-only + together with crunch-incoming-cookies + or crunch-outgoing-cookies. + If you do, cookies will be plainly killed.

+ +

Note that it is up to the browser how it handles such + cookies without an "expires" field. + If you use an exotic browser, you might want to try it out to + be sure.

+ +

This setting also has no effect on cookies that may have + been stored previously by the browser before starting + Privoxy. These would have to + be removed manually.

+ +

Privoxy also uses the + content-cookies + filter to block some types of cookies. Content cookies are + not effected by session-cookies-only.

+
+ +
Example usage:
+ +
+ + + + +
+
++session-cookies-only
+
+
+
+
+
+
+ +
+

8.5.33. set-image-blocker

+ +
+
+
Typical use:
+ +
+

Choose the replacement for blocked images

+
+ +
Effect:
+ +
+

This action alone doesn't do anything noticeable. If + both block + and handle-as-image + also apply, i.e. if + the request is to be blocked as an image, then the parameter of this action + decides what will be sent as a replacement.

+
+ +
Type:
+ +
+

Parameterized.

+
+ +
Parameter:
+ +
+
    +
  • +

    "pattern" to send a built-in + checkerboard pattern image. The image is visually decent, + scales very well, and makes it obvious where banners were + busted.

    +
  • + +
  • +

    "blank" to send a built-in + transparent image. This makes banners disappear completely, + but makes it hard to detect where Privoxy has blocked images on a given + page and complicates troubleshooting if Privoxy has blocked innocent images, + like navigation icons.

    +
  • + +
  • +

    "target-url" to send a redirect + to target-url. You can + redirect to any image anywhere, even in your local + filesystem via "file:///" URL. + (But note that not all browsers support redirecting to a + local file system).

    + +

    A good application of redirects is to use special + Privoxy-built-in URLs, + which send the built-in images, as target-url. This has the same visual + effect as specifying "blank" or + "pattern" in the first place, + but enables your browser to cache the replacement image, + instead of requesting it over and over again.

    +
  • +
+
+ +
Notes:
+ +
+

The URLs for the built-in images are "http://config.privoxy.org/send-banner?type=type", where type is either "blank" or "pattern".

+ +

There is a third (advanced) type, called "auto". It is NOT to be used in set-image-blocker, but meant for use from + filters. Auto will select the + type of image that would have applied to the referring page, + had it been an image.

+
+ +
Example usage:
+ +
+

Built-in pattern:

+ + + + + +
+
++set-image-blocker{pattern}
+
+
+ +

Redirect to the BSD daemon:

+ + + + + +
+
++set-image-blocker{http://www.freebsd.org/gifs/dae_up3.gif}
+
+
+ +

Redirect to the built-in pattern for better caching:

+ + + + + +
+
++set-image-blocker{http://config.privoxy.org/send-banner?type=pattern}
+
+
+
+
+
+
+ +
+

8.5.34. + Summary

+ +

Note that many of these actions have the potential to cause a page + to misbehave, possibly even not to display at all. There are many + ways a site designer may choose to design his site, and what HTTP + header content, and other criteria, he may depend on. There is no way + to have hard and fast rules for all sites. See the Appendix for a brief example on + troubleshooting actions.

+
+ + +
+

8.6. Aliases

+ +

Custom "actions", known to Privoxy as "aliases", + can be defined by combining other actions. These can in turn be invoked + just like the built-in actions. Currently, an alias name can contain + any character except space, tab, "=", + "{" and "}", but + we strongly recommend that + you only use "a" to "z", "0" to "9", "+", and "-". Alias names are not case sensitive, and are not + required to start with a "+" or "-" sign, since they are merely textually expanded.

+ +

Aliases can be used throughout the actions file, but they + must be defined in a special section + at the top of the file! And there can only be one such section + per actions file. Each actions file may have its own alias section, and + the aliases defined in it are only visible within that file.

+ +

There are two main reasons to use aliases: One is to save typing for + frequently used combinations of actions, the other one is a gain in + flexibility: If you decide once how you want to handle shops by + defining an alias called "shop", you can + later change your policy on shops in one place, and your changes will take + effect everywhere in the actions file where the "shop" alias is used. Calling aliases by their purpose + also makes your actions files more readable.

+ +

Currently, there is one big drawback to using aliases, though: + Privoxy's built-in web-based action + file editor honors aliases when reading the actions files, but it + expands them before writing. So the effects of your aliases are of + course preserved, but the aliases themselves are lost when you edit + sections that use aliases with it.

+ +

Now let's define some aliases...

+ + + +
+
+ # Useful custom aliases we can use later.
  #
  # Note the (required!) section header line and that this section
  # must be at the top of the actions file!
@@ -6876,79 +4296,46 @@
  # These aliases just save typing later:
  # (Note that some already use other aliases!)
  #
- +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
- -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
+ +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
+ -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
  +block-as-image      = +block{Blocked image.} +handle-as-image
- allow-all-cookies   = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
+ allow-all-cookies   = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
 
  # These aliases define combinations of actions
  # that are useful for certain types of sites:
  #
- fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -prevent-compression
-
- shop        = -crunch-all-cookies -filter{all-popups}
+ fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer -prevent-compression
+
+ shop        = -crunch-all-cookies -filter{all-popups}
 
  # Short names for other aliases, for really lazy people ;-)
  #
  c0 = +crunch-all-cookies
- c1 = -crunch-all-cookies

...and put them to use. These sections would appear in the lower part of an - actions file and define exceptions to the default actions (as specified further - up for the "/" pattern):

+ +
 # These sites are either very complex or very keen on
+ c1 = -crunch-all-cookies
+
+
+ +

...and put them to use. These sections would appear in the lower + part of an actions file and define exceptions to the default actions + (as specified further up for the "/" + pattern):

+ + + +
+
+ # These sites are either very complex or very keen on
  # user data and require minimal interference to work:
  #
  {fragile}
@@ -6959,7 +4346,7 @@
 
  # Shopping sites:
  # Allow cookies (for setting and retrieving your customer data)
- #           
+ #
  {shop}
  .quietpc.com
  .worldpay.com   # for quietpc.com
@@ -6969,234 +4356,123 @@
  #
  {-filter{all-popups} -filter{unsolicited-popups}}
   .dabs.com
-  .overclockers.co.uk

Aliases like "shop" and "fragile" are typically used for - "problem" sites that require more than one action to be disabled - in order to function properly.

8.7. Actions Files Tutorial

The above chapters have shown which actions files - there are and how they are organized, how actions are specified and applied - to URLs, how patterns work, and how to - define and use aliases. Now, let's look at an - example match-all.action, default.action - and user.action file and see how all these pieces come together:

8.7.1. match-all.action

Remember all actions are disabled when matching starts, - so we have to explicitly enable the ones we want.

While the match-all.action file only contains a - single section, it is probably the most important one. It has only one - pattern, "/", but this pattern - matches all URLs. Therefore, the set of - actions used in this "default" section will - be applied to all requests as a start. It can be partly or - wholly overridden by other actions files like default.action - and user.action, but it will still be largely responsible - for your overall browsing experience.

Again, at the start of matching, all actions are disabled, so there is - no need to disable any actions here. (Remember: a "+" - preceding the action name enables the action, a "-" disables!). - Also note how this long line has been made more readable by splitting it into - multiple lines with line continuation.

+ +
{ \
- +change-x-forwarded-for{block} \
- +hide-from-header{block} \
- +set-image-blocker{pattern} \
+  .overclockers.co.uk
+
+
+ +

Aliases like "shop" and "fragile" are typically used for "problem" sites that require more than one action to be + disabled in order to function properly.

+
+ +
+

8.7. Actions + Files Tutorial

+ +

The above chapters have shown which + actions files there are and how they are organized, how actions are + specified and applied to URLs, how patterns work, and how to define + and use aliases. Now, let's + look at an example match-all.action, + default.action and user.action file and see how all these pieces come + together:

+ +
+

8.7.1. + match-all.action

+ +

Remember all actions are + disabled when matching starts, so we have to explicitly enable + the ones we want.

+ +

While the match-all.action file only + contains a single section, it is probably the most important one. It + has only one pattern, "/", but this pattern matches all URLs. Therefore, the + set of actions used in this "default" + section will be applied to all + requests as a start. It can be partly or wholly overridden by + other actions files like default.action and + user.action, but it will still be largely + responsible for your overall browsing experience.

+ +

Again, at the start of matching, all actions are disabled, so + there is no need to disable any actions here. (Remember: a + "+" preceding the action name enables the + action, a "-" disables!). Also note how + this long line has been made more readable by splitting it into + multiple lines with line continuation.

+ + + +
+
+{ \
+ +change-x-forwarded-for{block} \
+ +hide-from-header{block} \
+ +set-image-blocker{pattern} \
 }
 / # Match all URLs
- 

The default behavior is now set.

8.7.2. default.action

If you aren't a developer, there's no need for you to edit the - default.action file. It is maintained by - the Privoxy developers and if you disagree with some of the - sections, you should overrule them in your user.action.

Understanding the default.action file can - help you with your user.action, though.

The first section in this file is a special section for internal use - that prevents older Privoxy versions from reading the file:

+ +
##########################################################################
+
+
+
+ +

The default behavior is now set.

+
+ +
+

8.7.2. + default.action

+ +

If you aren't a developer, there's no need for you to edit the + default.action file. It is maintained by + the Privoxy developers and if you + disagree with some of the sections, you should overrule them in your + user.action.

+ +

Understanding the default.action file + can help you with your user.action, + though.

+ +

The first section in this file is a special section for internal + use that prevents older Privoxy + versions from reading the file:

+ + + +
+
+##########################################################################
 # Settings -- Don't change! For internal Privoxy use ONLY.
 ##########################################################################
 {{settings}}
-for-privoxy-version=3.0.11

After that comes the (optional) alias section. We'll use the example - section from the above chapter on aliases, - that also explains why and how aliases are used:

+ +
##########################################################################
+for-privoxy-version=3.0.11
+
+
+ +

After that comes the (optional) alias section. We'll use the + example section from the above chapter on aliases, that also + explains why and how aliases are used:

+ + + +
+
+##########################################################################
 # Aliases
 ##########################################################################
 {{alias}}
@@ -7204,76 +4480,42 @@
  # These aliases just save typing later:
  # (Note that some already use other aliases!)
  #
- +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
- -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
+ +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
+ -crunch-all-cookies = -crunch-incoming-cookies -crunch-outgoing-cookies
  +block-as-image      = +block{Blocked image.} +handle-as-image
- mercy-for-cookies   = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
+ mercy-for-cookies   = -crunch-all-cookies -session-cookies-only -filter{content-cookies}
 
  # These aliases define combinations of actions
  # that are useful for certain types of sites:
  #
- fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer
- shop        = -crunch-all-cookies -filter{all-popups}

The first of our specialized sections is concerned with "fragile" - sites, i.e. sites that require minimum interference, because they are either - very complex or very keen on tracking you (and have mechanisms in place that - make them unusable for people who avoid being tracked). We will simply use - our pre-defined fragile alias instead of stating the list - of actions explicitly:

+ +
##########################################################################
+ fragile     = -block -filter -crunch-all-cookies -fast-redirects -hide-referrer
+ shop        = -crunch-all-cookies -filter{all-popups}
+
+
+ +

The first of our specialized sections is concerned with + "fragile" sites, i.e. sites that require + minimum interference, because they are either very complex or very + keen on tracking you (and have mechanisms in place that make them + unusable for people who avoid being tracked). We will simply use our + pre-defined fragile alias instead of stating + the list of actions explicitly:

+ + + +
+
+##########################################################################
 # Exceptions for sites that'll break under the default action set:
 ##########################################################################
 
@@ -7282,239 +4524,148 @@
 { fragile }
 .office.microsoft.com           # surprise, surprise!
 .windowsupdate.microsoft.com
-mail.google.com

Shopping sites are not as fragile, but they typically - require cookies to log in, and pop-up windows for shopping - carts or item details. Again, we'll use a pre-defined alias:

+ +
# Shopping sites:
+mail.google.com
+
+
+ +

Shopping sites are not as fragile, but they typically require + cookies to log in, and pop-up windows for shopping carts or item + details. Again, we'll use a pre-defined alias:

+ + + +
+
+# Shopping sites:
 #
 { shop }
-.quietpc.com 
+.quietpc.com
 .worldpay.com   # for quietpc.com
 .jungle.com
-.scan.co.uk

The fast-redirects - action, which may have been enabled in match-all.action, - breaks some sites. So disable it for popular sites where we know it misbehaves:

+ +
{ -fast-redirects }
+.scan.co.uk
+
+
+ +

The fast-redirects action, + which may have been enabled in match-all.action, breaks some sites. So disable it + for popular sites where we know it misbehaves:

+ + + +
+
+{ -fast-redirects }
 login.yahoo.com
 edit.*.yahoo.com
 .google.com
 .altavista.com/.*(like|url|link):http
 .altavista.com/trans.*urltext=http
-.nytimes.com

It is important that Privoxy knows which - URLs belong to images, so that if they are to - be blocked, a substitute image can be sent, rather than an HTML page. - Contacting the remote site to find out is not an option, since it - would destroy the loading time advantage of banner blocking, and it - would feed the advertisers information about you. We can mark any - URL as an image with the handle-as-image action, - and marking all URLs that end in a known image file extension is a - good start:

+ +
##########################################################################
+.nytimes.com
+
+
+ +

It is important that Privoxy + knows which URLs belong to images, so that if they are to be blocked, a substitute + image can be sent, rather than an HTML page. Contacting the remote + site to find out is not an option, since it would destroy the loading + time advantage of banner blocking, and it would feed the advertisers + information about you. We can mark any URL as an image with the + handle-as-image action, + and marking all URLs that end in a known image file extension is a + good start:

+ + + +
+
+##########################################################################
 # Images:
 ##########################################################################
 
 # Define which file types will be treated as images, in case they get
 # blocked further down this file:
 #
-{ +handle-as-image }
-/.*\.(gif|jpe?g|png|bmp|ico)$

And then there are known banner sources. They often use scripts to - generate the banners, so it won't be visible from the URL that the - request is for an image. Hence we block them and - mark them as images in one go, with the help of our - +block-as-image alias defined above. (We could of - course just as well use +block - +handle-as-image here.) - Remember that the type of the replacement image is chosen by the - set-image-blocker - action. Since all URLs have matched the default section with its - +set-image-blocker{pattern} - action before, it still applies and needn't be repeated:

+ +
# Known ad generators:
+{ +handle-as-image }
+/.*\.(gif|jpe?g|png|bmp|ico)$
+
+
+ +

And then there are known banner sources. They often use scripts to + generate the banners, so it won't be visible from the URL that the + request is for an image. Hence we block them and mark them as images in one go, with + the help of our +block-as-image alias + defined above. (We could of course just as well use +block +handle-as-image here.) + Remember that the type of the replacement image is chosen by the + set-image-blocker + action. Since all URLs have matched the default section with its + +set-image-blocker{pattern} + action before, it still applies and needn't be repeated:

+ + + +
+
+# Known ad generators:
 #
 { +block-as-image }
-ar.atwola.com 
+ar.atwola.com
 .ad.doubleclick.net
 .ad.*.doubleclick.net
 .a.yimg.com/(?:(?!/i/).)*$
 .a[0-9].yimg.com/(?:(?!/i/).)*$
 bs*.gsanet.com
-.qkimg.net

One of the most important jobs of Privoxy - is to block banners. Many of these can be "blocked" - by the filter{banners-by-size} - action, which we enabled above, and which deletes the references to banner - images from the pages while they are loaded, so the browser doesn't request - them anymore, and hence they don't need to be blocked here. But this naturally - doesn't catch all banners, and some people choose not to use filters, so we - need a comprehensive list of patterns for banner URLs here, and apply the - block action to them.

First comes many generic patterns, which do most of the work, by - matching typical domain and path name components of banners. Then comes - a list of individual patterns for specific sites, which is omitted here - to keep the example short:

+ +
##########################################################################
+.qkimg.net
+
+
+ +

One of the most important jobs of Privoxy is to block banners. Many of these can + be "blocked" by the filter{banners-by-size} action, + which we enabled above, and which deletes the references to banner + images from the pages while they are loaded, so the browser doesn't + request them anymore, and hence they don't need to be blocked here. + But this naturally doesn't catch all banners, and some people choose + not to use filters, so we need a comprehensive list of patterns for + banner URLs here, and apply the block action to them.

+ +

First comes many generic patterns, which do most of the work, by + matching typical domain and path name components of banners. Then + comes a list of individual patterns for specific sites, which is + omitted here to keep the example short:

+ + + +
+
+##########################################################################
 # Block these fine banners:
 ##########################################################################
-{ +block{Banner ads.} }
+{ +block{Banner ads.} }
 
 # Generic patterns:
-# 
+#
 ad*.
 .*ads.
 banner?.
@@ -7524,137 +4675,56 @@
 
 # Site-specific patterns (abbreviated):
 #
-.hitbox.com

It's quite remarkable how many advertisers actually call their banner - servers ads.company.com, or call the directory - in which the banners are stored simply "banners". So the above - generic patterns are surprisingly effective.

But being very generic, they necessarily also catch URLs that we don't want - to block. The pattern .*ads. e.g. catches - "nasty-ads.nasty-corp.com" as intended, - but also "downloads.sourcefroge.net" or - "adsl.some-provider.net." So here come some - well-known exceptions to the +block - section above.

Note that these are exceptions to exceptions from the default! Consider the URL - "downloads.sourcefroge.net": Initially, all actions are deactivated, - so it wouldn't get blocked. Then comes the defaults section, which matches the - URL, but just deactivates the block - action once again. Then it matches .*ads., an exception to the - general non-blocking policy, and suddenly - +block applies. And now, it'll match - .*loads., where -block - applies, so (unless it matches again further down) it ends up - with no block action applying.

+ +
##########################################################################
+.hitbox.com
+
+
+ +

It's quite remarkable how many advertisers actually call their + banner servers ads.company.com, or + call the directory in which the banners are stored simply + "banners". So the above generic patterns + are surprisingly effective.

+ +

But being very generic, they necessarily also catch URLs that we + don't want to block. The pattern .*ads. e.g. + catches "nasty-ads.nasty-corp.com" as intended, + but also "downloads.sourcefroge.net" or + "adsl.some-provider.net." So here + come some well-known exceptions to the +block section above.

+ +

Note that these are exceptions to exceptions from the default! + Consider the URL "downloads.sourcefroge.net": Initially, all actions + are deactivated, so it wouldn't get blocked. Then comes the defaults + section, which matches the URL, but just deactivates the block action + once again. Then it matches .*ads., an + exception to the general non-blocking policy, and suddenly +block applies. + And now, it'll match .*loads., where + -block + applies, so (unless it matches again further down) it ends up with no + block + action applying.

+ + + +
+
+##########################################################################
 # Save some innocent victims of the above generic block patterns:
 ##########################################################################
 
 # By domain:
-# 
-{ -block }
+#
+{ -block }
 adv[io]*.  # (for advogato.org and advice.*)
 adsl.      # (has nothing to do with ads)
 adobe.     # (has nothing to do with ads either)
@@ -7669,147 +4739,87 @@
 # Site-specific:
 #
 www.globalintersec.com/adv # (adv = advanced)
-www.ugu.com/sui/ugu/adv

Filtering source code can have nasty side effects, - so make an exception for our friends at sourceforge.net, - and all paths with "cvs" in them. Note that - -filter - disables all filters in one fell swoop!

+ +
# Don't filter code!
+www.ugu.com/sui/ugu/adv
+
+
+ +

Filtering source code can have nasty side effects, so make an + exception for our friends at sourceforge.net, and all paths with + "cvs" in them. Note that -filter + disables all filters in one + fell swoop!

+ + + +
+
+# Don't filter code!
 #
-{ -filter }
+{ -filter }
 /(.*/)?cvs
 bugzilla.
 developer.
 wiki.
-.sourceforge.net

The actual default.action is of course much more - comprehensive, but we hope this example made clear how it works.

8.7.3. user.action

So far we are painting with a broad brush by setting general policies, - which would be a reasonable starting point for many people. Now, - you might want to be more specific and have customized rules that - are more suitable to your personal habits and preferences. These would - be for narrowly defined situations like your ISP or your bank, and should - be placed in user.action, which is parsed after all other - actions files and hence has the last word, over-riding any previously - defined actions. user.action is also a - safe place for your personal settings, since - default.action is actively maintained by the - Privoxy developers and you'll probably want - to install updated versions from time to time.

So let's look at a few examples of things that one might typically do in - user.action:

# My user.action file. <fred@example.com>

As aliases are local to the actions - file that they are defined in, you can't use the ones from - default.action, unless you repeat them here:

+ +
# Aliases are local to the file they are defined in.
+.sourceforge.net
+
+
+ +

The actual default.action is of course + much more comprehensive, but we hope this example made clear how it + works.

+
+ +
+

8.7.3. + user.action

+ +

So far we are painting with a broad brush by setting general + policies, which would be a reasonable starting point for many people. + Now, you might want to be more specific and have customized rules + that are more suitable to your personal habits and preferences. These + would be for narrowly defined situations like your ISP or your bank, + and should be placed in user.action, which + is parsed after all other actions files and hence has the last word, + over-riding any previously defined actions. user.action is also a safe place for your personal settings, + since default.action is actively maintained + by the Privoxy developers and you'll + probably want to install updated versions from time to time.

+ +

So let's look at a few examples of things that one might typically + do in user.action:

+ + + + + +
+
+# My user.action file. <fred@example.com>
+
+
+ +

As aliases are local to + the actions file that they are defined in, you can't use the ones + from default.action, unless you repeat them + here:

+ + + +
+
+# Aliases are local to the file they are defined in.
 # (Re-)define aliases for this file:
 #
 {{alias}}
-# 
-# These aliases just save typing later, and the alias names should 
+#
+# These aliases just save typing later, and the alias names should
 # be self explanatory.
 #
 +crunch-all-cookies = +crunch-incoming-cookies +crunch-outgoing-cookies
@@ -7831,83 +4841,56 @@
 
 # Alias for specific file types that are text, but might have conflicting
 # MIME types. We want the browser to force these to be text documents.
-handle-as-text = -filter +-content-type-overwrite{text/plain} +-force-text-mode -hide-content-disposition

Say you have accounts on some sites that you visit regularly, and - you don't want to have to log in manually each time. So you'd like - to allow persistent cookies for these sites. The - allow-all-cookies alias defined above does exactly - that, i.e. it disables crunching of cookies in any direction, and the - processing of cookies to make them only temporary.

+ +
{ allow-all-cookies }
+handle-as-text = -filter +-content-type-overwrite{text/plain} +-force-text-mode -hide-content-disposition
+
+
+ +

Say you have accounts on some sites that you visit regularly, and + you don't want to have to log in manually each time. So you'd like to + allow persistent cookies for these sites. The allow-all-cookies alias defined above does exactly + that, i.e. it disables crunching of cookies in any direction, and the + processing of cookies to make them only temporary.

+ + + +
+
+{ allow-all-cookies }
  sourceforge.net
  .yahoo.com
  .msdn.microsoft.com
- .redhat.com

Your bank is allergic to some filter, but you don't know which, so you disable them all:

{ -filter }
- .your-home-banking-site.com

Some file types you may not want to filter for various reasons:

+ +
# Technical documentation is likely to contain strings that might
+ .redhat.com
+
+
+ +

Your bank is allergic to some filter, but you don't know which, so + you disable them all:

+ + + + + +
+
+{ -filter }
+ .your-home-banking-site.com
+
+
+ +

Some file types you may not want to filter for various + reasons:

+ + + +
+
+# Technical documentation is likely to contain strings that might
 # erroneously get altered by the JavaScript-oriented filters:
 #
 .tldp.org
@@ -7916,355 +4899,198 @@
 # And this stupid host sends streaming video with a wrong MIME type,
 # so that Privoxy thinks it is getting HTML and starts filtering:
 #
-stupid-server.example.com/

Example of a simple block action. Say you've - seen an ad on your favourite page on example.com that you want to get rid of. - You have right-clicked the image, selected "copy image location" - and pasted the URL below while removing the leading http://, into a - { +block{} } section. Note that { +handle-as-image - } need not be specified, since all URLs ending in - .gif will be tagged as images by the general rules as set - in default.action anyway:

+ +
{ +block{Nasty ads.} }
+stupid-server.example.com/
+
+
+ +

Example of a simple block + action. Say you've seen an ad on your favourite page on example.com + that you want to get rid of. You have right-clicked the image, + selected "copy image location" and pasted + the URL below while removing the leading http://, into a { +block{} } section. Note that { + +handle-as-image } need not be specified, since all URLs ending + in .gif will be tagged as images by the + general rules as set in default.action anyway:

+ + + +
+
+{ +block{Nasty ads.} }
  www.example.com/nasty-ads/sponsor\.gif
- another.example.net/more/junk/here/

The URLs of dynamically generated banners, especially from large banner - farms, often don't use the well-known image file name extensions, which - makes it impossible for Privoxy to guess - the file type just by looking at the URL. - You can use the +block-as-image alias defined above for - these cases. - Note that objects which match this rule but then turn out NOT to be an - image are typically rendered as a "broken image" icon by the - browser. Use cautiously.

+ +
{ +block-as-image }
+ another.example.net/more/junk/here/
+
+
+ +

The URLs of dynamically generated banners, especially from large + banner farms, often don't use the well-known image file name + extensions, which makes it impossible for Privoxy to guess the file type just by looking + at the URL. You can use the +block-as-image + alias defined above for these cases. Note that objects which match + this rule but then turn out NOT to be an image are typically rendered + as a "broken image" icon by the browser. + Use cautiously.

+ + + +
+
+{ +block-as-image }
  .doubleclick.net
  .fastclick.net
  /Realmedia/ads/
- ar.atwola.com/

Now you noticed that the default configuration breaks Forbes Magazine, - but you were too lazy to find out which action is the culprit, and you - were again too lazy to give feedback, so - you just used the fragile alias on the site, and - -- whoa! -- it worked. The fragile - aliases disables those actions that are most likely to break a site. Also, - good for testing purposes to see if it is Privoxy - that is causing the problem or not. We later find other regular sites - that misbehave, and add those to our personalized list of troublemakers:

+ +
{ fragile }
+ ar.atwola.com/
+
+
+ +

Now you noticed that the default configuration breaks Forbes + Magazine, but you were too lazy to find out which action is the + culprit, and you were again too lazy to give feedback, so you just used the fragile alias on the site, and -- whoa! -- it worked. The fragile aliases disables those actions that are most + likely to break a site. Also, good for testing purposes to see if it + is Privoxy that is causing the + problem or not. We later find other regular sites that misbehave, and + add those to our personalized list of troublemakers:

+ + + +
+
+{ fragile }
  .forbes.com
  webmail.example.com
- .mybank.com

You like the "fun" text replacements in default.filter, - but it is disabled in the distributed actions file. - So you'd like to turn it on in your private, - update-safe config, once and for all:

{ +filter{fun} }
- / # For ALL sites!

Note that the above is not really a good idea: There are exceptions - to the filters in default.action for things that - really shouldn't be filtered, like code on CVS->Web interfaces. Since - user.action has the last word, these exceptions - won't be valid for the "fun" filtering specified here.

You might also worry about how your favourite free websites are - funded, and find that they rely on displaying banner advertisements - to survive. So you might want to specifically allow banners for those - sites that you feel provide value to you:

+ +
{ allow-ads }
+ .mybank.com
+
+
+ +

You like the "fun" text replacements in + default.filter, but it is disabled in the + distributed actions file. So you'd like to turn it on in your + private, update-safe config, once and for all:

+ + + + + +
+
+{ +filter{fun} }
+ / # For ALL sites!
+
+
+ +

Note that the above is not really a good idea: There are + exceptions to the filters in default.action + for things that really shouldn't be filtered, like code on + CVS->Web interfaces. Since user.action + has the last word, these exceptions won't be valid for the + "fun" filtering specified here.

+ +

You might also worry about how your favourite free websites are + funded, and find that they rely on displaying banner advertisements + to survive. So you might want to specifically allow banners for those + sites that you feel provide value to you:

+ + + +
+
+{ allow-ads }
  .sourceforge.net
  .slashdot.org
- .osdn.net

Note that allow-ads has been aliased to - -block, - -filter{banners-by-size}, and - -filter{banners-by-link} above.

Invoke another alias here to force an over-ride of the MIME type application/x-sh which typically would open a download type - dialog. In my case, I want to look at the shell script, and then I can save - it should I choose to.

{ handle-as-text }
- /.*\.sh$

user.action is generally the best place to define - exceptions and additions to the default policies of - default.action. Some actions are safe to have their - default policies set here though. So let's set a default policy to have a - "blank" image as opposed to the checkerboard pattern for - ALL sites. "/" of course matches all URL - paths and patterns:

{ +set-image-blocker{blank} }
-/ # ALL sites


PrevHomeNext
The Main Configuration File Filter Files
\ No newline at end of file + .osdn.net +
+
+ +

Note that allow-ads has been aliased to + -block, -filter{banners-by-size}, + and -filter{banners-by-link} + above.

+ +

Invoke another alias here to force an over-ride of the MIME type + application/x-sh which typically would open + a download type dialog. In my case, I want to look at the shell + script, and then I can save it should I choose to.

+ + + + + +
+
+{ handle-as-text }
+ /.*\.sh$
+
+
+ +

user.action is generally the best place + to define exceptions and additions to the default policies of + default.action. Some actions are safe to + have their default policies set here though. So let's set a default + policy to have a "blank" image as opposed + to the checkerboard pattern for ALL sites. "/" of course matches all URL paths and patterns:

+ + + + + +
+
+{ +set-image-blocker{blank} }
+/ # ALL sites
+
+
+
+
+ + + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/appendix.html privoxy-3.0.19/doc/webserver/user-manual/appendix.html --- privoxy-3.0.17/doc/webserver/user-manual/appendix.html 2010-11-13 12:51:20.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/appendix.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,1454 +1,665 @@ - -Appendix - -
Privoxy 3.0.17 User Manual
Prev 

14. Appendix

14.1. Regular Expressions

Privoxy uses Perl-style "regular - expressions" in its actions - files and filter file, - through the PCRE and - PCRS libraries.

If you are reading this, you probably don't understand what "regular - expressions" are, or what they can do. So this will be a very brief - introduction only. A full explanation would require a book ;-)

Regular expressions provide a language to describe patterns that can be - run against strings of characters (letter, numbers, etc), to see if they - match the string or not. The patterns are themselves (sometimes complex) - strings of literal characters, combined with wild-cards, and other special - characters, called meta-characters. The "meta-characters" have - special meanings and are used to build complex patterns to be matched against. - Perl Compatible Regular Expressions are an especially convenient - "dialect" of the regular expression language.

To make a simple analogy, we do something similar when we use wild-card - characters when listing files with the dir command in DOS. - *.* matches all filenames. The "special" - character here is the asterisk which matches any and all characters. We can be - more specific and use ? to match just individual - characters. So "dir file?.text" would match - "file1.txt", "file2.txt", etc. We are pattern - matching, using a similar technique to "regular expressions"!

Regular expressions do essentially the same thing, but are much, much more - powerful. There are many more "special characters" and ways of - building complex patterns however. Let's look at a few of the common ones, - and then some examples:

. - Matches any single character, e.g. "a", - "A", "4", ":", or "@". -

? - The preceding character or expression is matched ZERO or ONE - times. Either/or. -

+ - The preceding character or expression is matched ONE or MORE - times. -

* - The preceding character or expression is matched ZERO or MORE - times. -

\ - The "escape" character denotes that - the following character should be taken literally. This is used where one of the - special characters (e.g. ".") needs to be taken literally and - not as a special meta-character. Example: "example\.com", makes - sure the period is recognized only as a period (and not expanded to its - meta-character meaning of any single character). -

[ ] - Characters enclosed in brackets will be matched if - any of the enclosed characters are encountered. For instance, "[0-9]" - matches any numeric digit (zero through nine). As an example, we can combine - this with "+" to match any digit one of more times: "[0-9]+". -

( ) - parentheses are used to group a sub-expression, - or multiple sub-expressions. -

| - The "bar" character works like an - "or" conditional statement. A match is successful if the - sub-expression on either side of "|" matches. As an example: - "/(this|that) example/" uses grouping and the bar character - and would match either "this example" or "that - example", and nothing else. -

These are just some of the ones you are likely to use when matching URLs with - Privoxy, and is a long way from a definitive - list. This is enough to get us started with a few simple examples which may - be more illuminating:

/.*/banners/.* - A simple example - that uses the common combination of "." and "*" to - denote any character, zero or more times. In other words, any string at all. - So we start with a literal forward slash, then our regular expression pattern - (".*") another literal forward slash, the string - "banners", another forward slash, and lastly another - ".*". We are building - a directory path here. This will match any file with the path that has a - directory named "banners" in it. The ".*" matches - any characters, and this could conceivably be more forward slashes, so it - might expand into a much longer looking path. For example, this could match: - "/eye/hate/spammers/banners/annoy_me_please.gif", or just - "/banners/annoying.html", or almost an infinite number of other - possible combinations, just so it has "banners" in the path - somewhere.

And now something a little more complex:

/.*/adv((er)?ts?|ertis(ing|ements?))?/ - - We have several literal forward slashes again ("/"), so we are - building another expression that is a file path statement. We have another - ".*", so we are matching against any conceivable sub-path, just so - it matches our expression. The only true literal that must - match our pattern is adv, together with - the forward slashes. What comes after the "adv" string is the - interesting part.

Remember the "?" means the preceding expression (either a - literal character or anything grouped with "(...)" in this case) - can exist or not, since this means either zero or one match. So - "((er)?ts?|ertis(ing|ements?))" is optional, as are the - individual sub-expressions: "(er)", - "(ing|ements?)", and the "s". The "|" - means "or". We have two of those. For instance, - "(ing|ements?)", can expand to match either "ing" - OR "ements?". What is being done here, is an - attempt at matching as many variations of "advertisement", and - similar, as possible. So this would expand to match just "adv", - or "advert", or "adverts", or - "advertising", or "advertisement", or - "advertisements". You get the idea. But it would not match - "advertizements" (with a "z"). We could fix that by - changing our regular expression to: - "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which would then match - either spelling.

/.*/advert[0-9]+\.(gif|jpe?g) - Again - another path statement with forward slashes. Anything in the square brackets - "[ ]" can be matched. This is using "0-9" as a - shorthand expression to mean any digit one through nine. It is the same as - saying "0123456789". So any digit matches. The "+" - means one or more of the preceding expression must be included. The preceding - expression here is what is in the square brackets -- in this case, any digit - one through nine. Then, at the end, we have a grouping: "(gif|jpe?g)". - This includes a "|", so this needs to match the expression on - either side of that bar character also. A simple "gif" on one side, and the other - side will in turn match either "jpeg" or "jpg", - since the "?" means the letter "e" is optional and - can be matched once or not at all. So we are building an expression here to - match image GIF or JPEG type image file. It must include the literal - string "advert", then one or more digits, and a "." - (which is now a literal, and not a special character, since it is escaped - with "\"), and lastly either "gif", or - "jpeg", or "jpg". Some possible matches would - include: "//advert1.jpg", - "/nasty/ads/advert1234.gif", - "/banners/from/hell/advert99.jpg". It would not match - "advert1.gif" (no leading slash), or - "/adverts232.jpg" (the expression does not include an - "s"), or "/advert1.jsp" ("jsp" is not - in the expression anywhere).

We are barely scratching the surface of regular expressions here so that you - can understand the default Privoxy - configuration files, and maybe use this knowledge to customize your own - installation. There is much, much more that can be done with regular - expressions. Now that you know enough to get started, you can learn more on - your own :/

More reading on Perl Compatible Regular expressions: - http://perldoc.perl.org/perlre.html

For information on regular expression based substitutions and their applications - in filters, please see the filter file tutorial - in this manual.

14.2. Privoxy's Internal Pages

Since Privoxy proxies each requested - web page, it is easy for Privoxy to - trap certain special URLs. In this way, we can talk directly to - Privoxy, and see how it is - configured, see how our rules are being applied, change these - rules and other configuration options, and even turn - Privoxy's filtering off, all with - a web browser.

The URLs listed below are the special ones that allow direct access - to Privoxy. Of course, - Privoxy must be running to access these. If - not, you will get a friendly error message. Internet access is not - necessary either.

These may be bookmarked for quick reference. See next.

14.2.1. Bookmarklets

Below are some "bookmarklets" to allow you to easily access a - "mini" version of some of Privoxy's - special pages. They are designed for MS Internet Explorer, but should work - equally well in Netscape, Mozilla, and other browsers which support - JavaScript. They are designed to run directly from your bookmarks - not by - clicking the links below (although that should work for testing).

To save them, right-click the link and choose "Add to Favorites" - (IE) or "Add Bookmark" (Netscape). You will get a warning that - the bookmark "may not be safe" - just click OK. Then you can run the - Bookmarklet directly from your favorites/bookmarks. For even faster access, - you can put them on the "Links" bar (IE) or the "Personal - Toolbar" (Netscape), and run them with a single click.

Credit: The site which gave us the general idea for these bookmarklets is - www.bookmarklets.com. They - have more information about bookmarklets.

14.3. Chain of Events

Let's take a quick look at how some of Privoxy's - core features are triggered, and the ensuing sequence of events when a web - page is requested by your browser:

  • First, your web browser requests a web page. The browser knows to send - the request to Privoxy, which will in turn, - relay the request to the remote web server after passing the following - tests: -

  • Privoxy traps any request for its own internal CGI - pages (e.g http://p.p/) and sends the CGI page back to the browser. -

  • Next, Privoxy checks to see if the URL - matches any "+block" patterns. If - so, the URL is then blocked, and the remote web server will not be contacted. - "+handle-as-image" - and - "+handle-as-empty-document" - are then checked, and if there is no match, an - HTML "BLOCKED" page is sent back to the browser. Otherwise, if - it does match, an image is returned for the former, and an empty text - document for the latter. The type of image would depend on the setting of - "+set-image-blocker" - (blank, checkerboard pattern, or an HTTP redirect to an image elsewhere). -

  • Untrusted URLs are blocked. If URLs are being added to the - trust file, then that is done. -

  • If the URL pattern matches the "+fast-redirects" action, - it is then processed. Unwanted parts of the requested URL are stripped. -

  • Now the rest of the client browser's request headers are processed. If any - of these match any of the relevant actions (e.g. "+hide-user-agent", - etc.), headers are suppressed or forged as determined by these actions and - their parameters. -

  • Now the web server starts sending its response back (i.e. typically a web - page). -

  • First, the server headers are read and processed to determine, among other - things, the MIME type (document type) and encoding. The headers are then - filtered as determined by the - "+crunch-incoming-cookies", - "+session-cookies-only", - and "+downgrade-http-version" - actions. -

  • If any "+filter" action - or "+deanimate-gifs" - action applies (and the document type fits the action), the rest of the page is - read into memory (up to a configurable limit). Then the filter rules (from - default.filter and any other filter files) are - processed against the buffered content. Filters are applied in the order - they are specified in one of the filter files. Animated GIFs, if present, - are reduced to either the first or last frame, depending on the action - setting.The entire page, which is now filtered, is then sent by - Privoxy back to your browser. -

    If neither a "+filter" action - or "+deanimate-gifs" - matches, then Privoxy passes the raw data through - to the client browser as it becomes available. -

  • As the browser receives the now (possibly filtered) page content, it - reads and then requests any URLs that may be embedded within the page - source, e.g. ad images, stylesheets, JavaScript, other HTML documents (e.g. - frames), sounds, etc. For each of these objects, the browser issues a - separate request (this is easily viewable in Privoxy's - logs). And each such request is in turn processed just as above. Note that a - complex web page will have many, many such embedded URLs. If these - secondary requests are to a different server, then quite possibly a very - differing set of actions is triggered. -

NOTE: This is somewhat of a simplistic overview of what happens with each URL - request. For the sake of brevity and simplicity, we have focused on - Privoxy's core features only.

14.4. Troubleshooting: Anatomy of an Action

The way Privoxy applies - actions and filters - to any given URL can be complex, and not always so - easy to understand what is happening. And sometimes we need to be able to - see just what Privoxy is - doing. Especially, if something Privoxy is doing - is causing us a problem inadvertently. It can be a little daunting to look at - the actions and filters files themselves, since they tend to be filled with - regular expressions whose consequences are not - always so obvious.

One quick test to see if Privoxy is causing a problem - or not, is to disable it temporarily. This should be the first troubleshooting - step. See the Bookmarklets section on a quick - and easy way to do this (be sure to flush caches afterward!). Looking at the - logs is a good idea too. (Note that both the toggle feature and logging are - enabled via config file settings, and may need to be - turned "on".)

Another easy troubleshooting step to try is if you have done any - customization of your installation, revert back to the installed - defaults and see if that helps. There are times the developers get complaints - about one thing or another, and the problem is more related to a customized - configuration issue.

Privoxy also provides the - http://config.privoxy.org/show-url-info - page that can show us very specifically how actions - are being applied to any given URL. This is a big help for troubleshooting.

First, enter one URL (or partial URL) at the prompt, and then - Privoxy will tell us - how the current configuration will handle it. This will not - help with filtering effects (i.e. the "+filter" action) from - one of the filter files since this is handled very - differently and not so easy to trap! It also will not tell you about any other - URLs that may be embedded within the URL you are testing. For instance, images - such as ads are expressed as URLs within the raw page source of HTML pages. So - you will only get info for the actual URL that is pasted into the prompt area - -- not any sub-URLs. If you want to know about embedded URLs like ads, you - will have to dig those out of the HTML source. Use your browser's "View - Page Source" option for this. Or right click on the ad, and grab the - URL.

Let's try an example, google.com, - and look at it one section at a time in a sample configuration (your real - configuration may vary):

+ +
 Matches for http://www.google.com:
-
- In file: default.action [ View ] [ Edit ]
+
+
+
+
+  
+
+  Appendix
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

14. Appendix

+ +
+

14.1. Regular + Expressions

+ +

Privoxy uses Perl-style + "regular expressions" in its actions files and filter file, through the PCRE and PCRS libraries.

+ +

If you are reading this, you probably don't understand what + "regular expressions" are, or what they can + do. So this will be a very brief introduction only. A full explanation + would require a book ;-)

+ +

Regular expressions provide a language to describe patterns that can + be run against strings of characters (letter, numbers, etc), to see if + they match the string or not. The patterns are themselves (sometimes + complex) strings of literal characters, combined with wild-cards, and + other special characters, called meta-characters. The "meta-characters" have special meanings and are used to + build complex patterns to be matched against. Perl Compatible Regular + Expressions are an especially convenient "dialect" of the regular expression language.

+ +

To make a simple analogy, we do something similar when we use + wild-card characters when listing files with the dir command in DOS. *.* matches + all filenames. The "special" character here + is the asterisk which matches any and all characters. We can be more + specific and use ? to match just individual + characters. So "dir file?.text" would match + "file1.txt", "file2.txt", etc. We are pattern matching, using a + similar technique to "regular + expressions"!

+ +

Regular expressions do essentially the same thing, but are much, + much more powerful. There are many more "special + characters" and ways of building complex patterns however. Let's + look at a few of the common ones, and then some examples:

+ + + + + + + +
. - Matches any + single character, e.g. "a", + "A", "4", + ":", or "@".
+ + + + + + + +
? - The preceding + character or expression is matched ZERO or ONE times. + Either/or.
+ + + + + + + +
+ - The preceding + character or expression is matched ONE or MORE times.
+ + + + + + + +
* - The preceding + character or expression is matched ZERO or MORE times.
+ + + + + + + +
\ - The + "escape" character denotes that the + following character should be taken literally. This is used where + one of the special characters (e.g. ".") needs to be taken literally and not as a + special meta-character. Example: "example\.com", makes sure the period is + recognized only as a period (and not expanded to its + meta-character meaning of any single character).
+ + + + + + + +
[ ] - Characters + enclosed in brackets will be matched if any of the enclosed + characters are encountered. For instance, "[0-9]" matches any numeric digit (zero through + nine). As an example, we can combine this with "+" to match any digit one of more times: + "[0-9]+".
+ + + + + + + +
( ) - parentheses + are used to group a sub-expression, or multiple + sub-expressions.
+ + + + + + + +
| - The + "bar" character works like an + "or" conditional statement. A match is + successful if the sub-expression on either side of "|" matches. As an example: "/(this|that) example/" uses grouping and the bar + character and would match either "this + example" or "that example", and + nothing else.
+ +

These are just some of the ones you are likely to use when matching + URLs with Privoxy, and is a long way + from a definitive list. This is enough to get us started with a few + simple examples which may be more illuminating:

+ +

/.*/banners/.* - A simple example that uses the + common combination of "." and "*" to denote any character, zero or more times. In + other words, any string at all. So we start with a literal forward + slash, then our regular expression pattern (".*") another literal forward slash, the string + "banners", another forward slash, and lastly + another ".*". We are building a directory + path here. This will match any file with the path that has a directory + named "banners" in it. The ".*" matches any characters, and this could conceivably + be more forward slashes, so it might expand into a much longer looking + path. For example, this could match: "/eye/hate/spammers/banners/annoy_me_please.gif", or + just "/banners/annoying.html", or almost an + infinite number of other possible combinations, just so it has + "banners" in the path somewhere.

+ +

And now something a little more complex:

+ +

/.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have + several literal forward slashes again ("/"), + so we are building another expression that is a file path statement. We + have another ".*", so we are matching + against any conceivable sub-path, just so it matches our expression. + The only true literal that must + match our pattern is adv, + together with the forward slashes. What comes after the "adv" string is the interesting part.

+ +

Remember the "?" means the preceding + expression (either a literal character or anything grouped with + "(...)" in this case) can exist or not, + since this means either zero or one match. So "((er)?ts?|ertis(ing|ements?))" is optional, as are the + individual sub-expressions: "(er)", + "(ing|ements?)", and the "s". The "|" means + "or". We have two of those. For instance, + "(ing|ements?)", can expand to match either + "ing" OR "ements?". + What is being done here, is an attempt at matching as many variations + of "advertisement", and similar, as + possible. So this would expand to match just "adv", or "advert", or + "adverts", or "advertising", or "advertisement", or "advertisements". You get the idea. But it would not + match "advertizements" (with a "z"). We could fix that by changing our regular + expression to: "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which + would then match either spelling.

+ +

/.*/advert[0-9]+\.(gif|jpe?g) - Again another + path statement with forward slashes. Anything in the square brackets + "[ ]" can be matched. This is using + "0-9" as a shorthand expression to mean any + digit one through nine. It is the same as saying "0123456789". So any digit matches. The "+" means one or more of the preceding expression must + be included. The preceding expression here is what is in the square + brackets -- in this case, any digit one through nine. Then, at the end, + we have a grouping: "(gif|jpe?g)". This + includes a "|", so this needs to match the + expression on either side of that bar character also. A simple + "gif" on one side, and the other side will + in turn match either "jpeg" or "jpg", since the "?" means + the letter "e" is optional and can be + matched once or not at all. So we are building an expression here to + match image GIF or JPEG type image file. It must include the literal + string "advert", then one or more digits, + and a "." (which is now a literal, and not a + special character, since it is escaped with "\"), and lastly either "gif", or "jpeg", or + "jpg". Some possible matches would include: + "//advert1.jpg", "/nasty/ads/advert1234.gif", "/banners/from/hell/advert99.jpg". It would not match + "advert1.gif" (no leading slash), or + "/adverts232.jpg" (the expression does not + include an "s"), or "/advert1.jsp" ("jsp" is not + in the expression anywhere).

+ +

We are barely scratching the surface of regular expressions here so + that you can understand the default Privoxy configuration files, and maybe use this + knowledge to customize your own installation. There is much, much more + that can be done with regular expressions. Now that you know enough to + get started, you can learn more on your own :/

+ +

More reading on Perl Compatible Regular expressions: http://perldoc.perl.org/perlre.html

+ +

For information on regular expression based substitutions and their + applications in filters, please see the filter file tutorial in this manual.

+
+ +
+

14.2. Privoxy's + Internal Pages

+ +

Since Privoxy proxies each + requested web page, it is easy for Privoxy to trap certain special URLs. In this way, + we can talk directly to Privoxy, and + see how it is configured, see how our rules are being applied, change + these rules and other configuration options, and even turn Privoxy's filtering off, all with a web + browser.

+ +

The URLs listed below are the special ones that allow direct access + to Privoxy. Of course, Privoxy must be running to access these. If not, + you will get a friendly error message. Internet access is not necessary + either.

+ + + +

These may be bookmarked for quick reference. See next.

+ +
+

14.2.1. + Bookmarklets

+ +

Below are some "bookmarklets" to allow + you to easily access a "mini" version of + some of Privoxy's special pages. + They are designed for MS Internet Explorer, but should work equally + well in Netscape, Mozilla, and other browsers which support + JavaScript. They are designed to run directly from your bookmarks - + not by clicking the links below (although that should work for + testing).

+ +

To save them, right-click the link and choose "Add to Favorites" (IE) or "Add + Bookmark" (Netscape). You will get a warning that the bookmark + "may not be safe" - just click OK. Then + you can run the Bookmarklet directly from your favorites/bookmarks. + For even faster access, you can put them on the "Links" bar (IE) or the "Personal + Toolbar" (Netscape), and run them with a single click.

+ + + +

Credit: The site which gave us the general idea for these + bookmarklets is www.bookmarklets.com. They have more information about + bookmarklets.

+
+
+ +
+

14.3. Chain of + Events

+ +

Let's take a quick look at how some of Privoxy's core features are triggered, and the + ensuing sequence of events when a web page is requested by your + browser:

+ +
    +
  • +

    First, your web browser requests a web page. The browser knows + to send the request to Privoxy, + which will in turn, relay the request to the remote web server + after passing the following tests:

    +
  • + +
  • +

    Privoxy traps any request for + its own internal CGI pages (e.g http://p.p/) and sends the CGI page back to the + browser.

    +
  • + +
  • +

    Next, Privoxy checks to see if + the URL matches any "+block" patterns. If so, the URL is then + blocked, and the remote web server will not be contacted. "+handle-as-image" and "+handle-as-empty-document" are then checked, + and if there is no match, an HTML "BLOCKED" page is sent back to the browser. + Otherwise, if it does match, an image is returned for the former, + and an empty text document for the latter. The type of image would + depend on the setting of "+set-image-blocker" (blank, checkerboard + pattern, or an HTTP redirect to an image elsewhere).

    +
  • + +
  • +

    Untrusted URLs are blocked. If URLs are being added to the + trust file, then that is done.

    +
  • + +
  • +

    If the URL pattern matches the "+fast-redirects" action, it is then processed. + Unwanted parts of the requested URL are stripped.

    +
  • + +
  • +

    Now the rest of the client browser's request headers are + processed. If any of these match any of the relevant actions (e.g. + "+hide-user-agent", etc.), headers are + suppressed or forged as determined by these actions and their + parameters.

    +
  • + +
  • +

    Now the web server starts sending its response back (i.e. + typically a web page).

    +
  • + +
  • +

    First, the server headers are read and processed to determine, + among other things, the MIME type (document type) and encoding. The + headers are then filtered as determined by the "+crunch-incoming-cookies", "+session-cookies-only", and "+downgrade-http-version" actions.

    +
  • + +
  • +

    If any "+filter" action or "+deanimate-gifs" action applies (and the + document type fits the action), the rest of the page is read into + memory (up to a configurable limit). Then the filter rules (from + default.filter and any other filter + files) are processed against the buffered content. Filters are + applied in the order they are specified in one of the filter files. + Animated GIFs, if present, are reduced to either the first or last + frame, depending on the action setting.The entire page, which is + now filtered, is then sent by Privoxy back to your browser.

    + +

    If neither a "+filter" action or "+deanimate-gifs" matches, then Privoxy passes the raw data through to the + client browser as it becomes available.

    +
  • + +
  • +

    As the browser receives the now (possibly filtered) page + content, it reads and then requests any URLs that may be embedded + within the page source, e.g. ad images, stylesheets, JavaScript, + other HTML documents (e.g. frames), sounds, etc. For each of these + objects, the browser issues a separate request (this is easily + viewable in Privoxy's logs). And + each such request is in turn processed just as above. Note that a + complex web page will have many, many such embedded URLs. If these + secondary requests are to a different server, then quite possibly a + very differing set of actions is triggered.

    +
  • +
+ +

NOTE: This is somewhat of a simplistic overview of what happens with + each URL request. For the sake of brevity and simplicity, we have + focused on Privoxy's core features + only.

+
+ +
+

14.4. + Troubleshooting: Anatomy of an Action

+ +

The way Privoxy applies actions and filters to any given URL can be complex, + and not always so easy to understand what is happening. And sometimes + we need to be able to see + just what Privoxy is doing. + Especially, if something Privoxy is + doing is causing us a problem inadvertently. It can be a little + daunting to look at the actions and filters files themselves, since + they tend to be filled with regular + expressions whose consequences are not always so obvious.

+ +

One quick test to see if Privoxy is + causing a problem or not, is to disable it temporarily. This should be + the first troubleshooting step. See the Bookmarklets section on a quick + and easy way to do this (be sure to flush caches afterward!). Looking + at the logs is a good idea too. (Note that both the toggle feature and + logging are enabled via config file settings, + and may need to be turned "on".)

+ +

Another easy troubleshooting step to try is if you have done any + customization of your installation, revert back to the installed + defaults and see if that helps. There are times the developers get + complaints about one thing or another, and the problem is more related + to a customized configuration issue.

+ +

Privoxy also provides the http://config.privoxy.org/show-url-info page that can show + us very specifically how actions are + being applied to any given URL. This is a big help for + troubleshooting.

+ +

First, enter one URL (or partial URL) at the prompt, and then + Privoxy will tell us how the current + configuration will handle it. This will not help with filtering effects + (i.e. the "+filter" action) from one of the filter files since + this is handled very differently and not so easy to trap! It also will + not tell you about any other URLs that may be embedded within the URL + you are testing. For instance, images such as ads are expressed as URLs + within the raw page source of HTML pages. So you will only get info for + the actual URL that is pasted into the prompt area -- not any sub-URLs. + If you want to know about embedded URLs like ads, you will have to dig + those out of the HTML source. Use your browser's "View Page Source" option for this. Or right click on + the ad, and grab the URL.

+ +

Let's try an example, google.com, and look at it one section at a time in a sample + configuration (your real configuration may vary):

+ + + +
+
+ Matches for http://www.google.com:
+
+ In file: default.action [ View ] [ Edit ]
 
  {+change-x-forwarded-for{block}
  +deanimate-gifs {last}
@@ -1464,180 +675,86 @@
  +session-cookies-only
  +set-image-blocker {pattern}
 /
- 
+
  { -session-cookies-only }
  .google.com
 
  { -fast-redirects }
  .google.com
 
-In file: user.action [ View ] [ Edit ]
-(no matches in this file)  

This is telling us how we have defined our - "actions", and - which ones match for our test case, "google.com". - Displayed is all the actions that are available to us. Remember, - the + sign denotes "on". - - denotes "off". So some are "on" here, but many - are "off". Each example we try may provide a slightly different - end result, depending on our configuration directives.

The first listing - is for our default.action file. The large, multi-line - listing, is how the actions are set to match for all URLs, i.e. our default - settings. If you look at your "actions" file, this would be the - section just below the "aliases" section near the top. This - will apply to all URLs as signified by the single forward slash at the end - of the listing -- " / ".

But we have defined additional actions that would be exceptions to these general - rules, and then we list specific URLs (or patterns) that these exceptions - would apply to. Last match wins. Just below this then are two explicit - matches for ".google.com". The first is negating our previous - cookie setting, which was for "+session-cookies-only" - (i.e. not persistent). So we will allow persistent cookies for google, at - least that is how it is in this example. The second turns - off any "+fast-redirects" - action, allowing this to take place unmolested. Note that there is a leading - dot here -- ".google.com". This will match any hosts and - sub-domains, in the google.com domain also, such as - "www.google.com" or "mail.google.com". But it would not - match "www.google.de"! So, apparently, we have these two actions - defined as exceptions to the general rules at the top somewhere in the lower - part of our default.action file, and - "google.com" is referenced somewhere in these latter sections.

Then, for our user.action file, we again have no hits. - So there is nothing google-specific that we might have added to our own, local - configuration. If there was, those actions would over-rule any actions from - previously processed files, such as default.action. - user.action typically has the last word. This is the - best place to put hard and fast exceptions,

And finally we pull it all together in the bottom section and summarize how - Privoxy is applying all its "actions" - to "google.com":

+ +

 Final results:
- 
+In file: user.action [ View ] [ Edit ]
+(no matches in this file)
+
+
+ +

This is telling us how we have defined our "actions", + and which ones match for our test case, "google.com". Displayed is all the actions that are + available to us. Remember, the + sign denotes + "on". - denotes + "off". So some are "on" here, but many are "off". Each example we try may provide a slightly + different end result, depending on our configuration directives.

+ +

The first listing is for our default.action file. The large, multi-line listing, is + how the actions are set to match for all URLs, i.e. our default + settings. If you look at your "actions" + file, this would be the section just below the "aliases" section near the top. This will apply to all + URLs as signified by the single forward slash at the end of the listing + -- " / ".

+ +

But we have defined additional actions that would be exceptions to + these general rules, and then we list specific URLs (or patterns) that + these exceptions would apply to. Last match wins. Just below this then + are two explicit matches for ".google.com". + The first is negating our previous cookie setting, which was for + "+session-cookies-only" (i.e. not persistent). So we + will allow persistent cookies for google, at least that is how it is in + this example. The second turns off any "+fast-redirects" action, allowing this to take + place unmolested. Note that there is a leading dot here -- ".google.com". This will match any hosts and + sub-domains, in the google.com domain also, such as "www.google.com" or "mail.google.com". But it would not match "www.google.de"! So, apparently, we have these two + actions defined as exceptions to the general rules at the top somewhere + in the lower part of our default.action file, + and "google.com" is referenced somewhere in + these latter sections.

+ +

Then, for our user.action file, we again + have no hits. So there is nothing google-specific that we might have + added to our own, local configuration. If there was, those actions + would over-rule any actions from previously processed files, such as + default.action. user.action typically has the last word. This is the + best place to put hard and fast exceptions,

+ +

And finally we pull it all together in the bottom section and + summarize how Privoxy is applying all + its "actions" to "google.com":

+ + + +
+
+
 Final results:
+
  -add-header
  -block
- +change-x-forwarded-for{block} 
+ +change-x-forwarded-for{block}
  -client-header-filter{hide-tor-exit-notation}
  -content-type-overwrite
  -crunch-client-header
@@ -1688,142 +805,79 @@
  -prevent-compression
  -redirect
  -server-header-filter{xml-to-html}
- -server-header-filter{html-to-xml} 
+ -server-header-filter{html-to-xml}
  -session-cookies-only
- +set-image-blocker {pattern} 

Notice the only difference here to the previous listing, is to - "fast-redirects" and "session-cookies-only", - which are activated specifically for this site in our configuration, - and thus show in the "Final Results".

Now another example, "ad.doubleclick.net":

+ +

 { +block{Domains starts with "ad"} }
+ +set-image-blocker {pattern}
+
+
+ +

Notice the only difference here to the previous listing, is to + "fast-redirects" and "session-cookies-only", which are activated specifically + for this site in our configuration, and thus show in the "Final Results".

+ +

Now another example, "ad.doubleclick.net":

+ + + +
+
+
 { +block{Domains starts with "ad"} }
   ad*.
 
  { +block{Domain contains "ad"} }
   .ad.
 
  { +block{Doubleclick banner server} +handle-as-image }
-  .[a-vx-z]*.doubleclick.net

We'll just show the interesting part here - the explicit matches. It is - matched three different times. Two "+block{}" sections, - and a "+block{} +handle-as-image", - which is the expanded form of one of our aliases that had been defined as: - "+block-as-image". ("Aliases" are defined in - the first section of the actions file and typically used to combine more - than one action.)

Any one of these would have done the trick and blocked this as an unwanted - image. This is unnecessarily redundant since the last case effectively - would also cover the first. No point in taking chances with these guys - though ;-) Note that if you want an ad or obnoxious - URL to be invisible, it should be defined as "ad.doubleclick.net" - is done here -- as both a "+block{}" - and an - "+handle-as-image". - The custom alias "+block-as-image" just - simplifies the process and make it more readable.

One last example. Let's try "http://www.example.net/adsl/HOWTO/". - This one is giving us problems. We are getting a blank page. Hmmm ...

+ +

 Matches for http://www.example.net/adsl/HOWTO/:
-
- In file: default.action [ View ] [ Edit ]
+  .[a-vx-z]*.doubleclick.net
+
+
+ +

We'll just show the interesting part here - the explicit matches. It + is matched three different times. Two "+block{}" sections, and a "+block{} + +handle-as-image", which is the expanded form of one of our + aliases that had been defined as: "+block-as-image". ("Aliases" + are defined in the first section of the actions file and typically used + to combine more than one action.)

+ +

Any one of these would have done the trick and blocked this as an + unwanted image. This is unnecessarily redundant since the last case + effectively would also cover the first. No point in taking chances with + these guys though ;-) Note that if you want an ad or obnoxious URL to + be invisible, it should be defined as "ad.doubleclick.net" is done here -- as both a "+block{}" + and an "+handle-as-image". The custom alias "+block-as-image" just + simplifies the process and make it more readable.

- {-add-header +

One last example. Let's try "http://www.example.net/adsl/HOWTO/". This one is giving + us problems. We are getting a blank page. Hmmm ...

+ + + +
+
+
 Matches for http://www.example.net/adsl/HOWTO/:
+
+ In file: default.action [ View ] [ Edit ]
+
+ {-add-header
   -block
-  +change-x-forwarded-for{block} 
+  +change-x-forwarded-for{block}
   -client-header-filter{hide-tor-exit-notation}
   -content-type-overwrite
   -crunch-client-header
@@ -1831,8 +885,8 @@
   -crunch-incoming-cookies
   -crunch-outgoing-cookies
   -crunch-server-header
-  +deanimate-gifs 
-  -downgrade-http-version 
+  +deanimate-gifs
+  -downgrade-http-version
   +fast-redirects {check-decoded-url}
   -filter {js-events}
   -filter {content-cookies}
@@ -1862,326 +916,186 @@
   -filter {no-ping}
   -force-text-mode
   -handle-as-empty-document
-  -handle-as-image 
+  -handle-as-image
   -hide-accept-language
-  -hide-content-disposition  
-  +hide-from-header{block} 
-  +hide-referer{forge} 
-  -hide-user-agent 
+  -hide-content-disposition
+  +hide-from-header{block}
+  +hide-referer{forge}
+  -hide-user-agent
   -overwrite-last-modified
-  +prevent-compression 
+  +prevent-compression
   -redirect
   -server-header-filter{xml-to-html}
-  -server-header-filter{html-to-xml} 
-  +session-cookies-only 
+  -server-header-filter{html-to-xml}
+  +session-cookies-only
   +set-image-blocker{blank} }
    /
 
  { +block{Path contains "ads".} +handle-as-image }
-  /ads

Ooops, the "/adsl/" is matching "/ads" in our - configuration! But we did not want this at all! Now we see why we get the - blank page. It is actually triggering two different actions here, and - the effects are aggregated so that the URL is blocked, and Privoxy is told - to treat the block as if it were an image. But this is, of course, all wrong. - We could now add a new action below this (or better in our own - user.action file) that explicitly - un blocks ( - "{-block}") paths with - "adsl" in them (remember, last match in the configuration - wins). There are various ways to handle such exceptions. Example:


 { -block }
-  /adsl

Now the page displays ;-) - Remember to flush your browser's caches when making these kinds of changes to - your configuration to insure that you get a freshly delivered page! Or, try - using Shift+Reload.

But now what about a situation where we get no explicit matches like - we did with:


 { +block{Path starts with "ads".} +handle-as-image }
- /ads

That actually was very helpful and pointed us quickly to where the problem - was. If you don't get this kind of match, then it means one of the default - rules in the first section of default.action is causing - the problem. This would require some guesswork, and maybe a little trial and - error to isolate the offending rule. One likely cause would be one of the - "+filter" actions. - These tend to be harder to troubleshoot. - Try adding the URL for the site to one of aliases that turn off - "+filter":

+ +

 { shop }
+  /ads
+
+
+ +

Ooops, the "/adsl/" is matching + "/ads" in our configuration! But we did not + want this at all! Now we see why we get the blank page. It is actually + triggering two different actions here, and the effects are aggregated + so that the URL is blocked, and Privoxy is told to treat the block as if it were + an image. But this is, of course, all wrong. We could now add a new + action below this (or better in our own user.action file) that explicitly un blocks ( "{-block}") + paths with "adsl" in them (remember, last + match in the configuration wins). There are various ways to handle such + exceptions. Example:

+ + + + + +
+
+
 { -block }
+  /adsl
+
+
+ +

Now the page displays ;-) Remember to flush your browser's caches + when making these kinds of changes to your configuration to insure that + you get a freshly delivered page! Or, try using Shift+Reload.

+ +

But now what about a situation where we get no explicit matches like + we did with:

+ + + + + +
+
+
 { +block{Path starts with "ads".} +handle-as-image }
+ /ads
+
+
+ +

That actually was very helpful and pointed us quickly to where the + problem was. If you don't get this kind of match, then it means one of + the default rules in the first section of default.action is causing the problem. This would + require some guesswork, and maybe a little trial and error to isolate + the offending rule. One likely cause would be one of the "+filter" + actions. These tend to be harder to troubleshoot. Try adding the URL + for the site to one of aliases that turn off "+filter":

+ + + +
+
+
 { shop }
  .quietpc.com
  .worldpay.com   # for quietpc.com
  .jungle.com
  .scan.co.uk
- .forbes.com

"{ shop }" is an "alias" that expands to - "{ -filter -session-cookies-only }". - Or you could do your own exception to negate filtering:

+ +

 { -filter }
+ .forbes.com
+
+
+ +

"{ shop }" is an + "alias" that expands to "{ -filter -session-cookies-only + }". Or you could do your own exception to negate + filtering:

+ + + +
+
+
 { -filter }
  # Disable ALL filter actions for sites in this section
  .forbes.com
  developer.ibm.com
- localhost

This would turn off all filtering for these sites. This is best - put in user.action, for local site - exceptions. Note that when a simple domain pattern is used by itself (without - the subsequent path portion), all sub-pages within that domain are included - automatically in the scope of the action.

Images that are inexplicably being blocked, may well be hitting the -"+filter{banners-by-size}" - rule, which assumes - that images of certain sizes are ad banners (works well - most of the time since these tend to be standardized).

"{ fragile }" is an alias that disables most - actions that are the most likely to cause trouble. This can be used as a - last resort for problem sites.

+ +

 { fragile }
+ localhost
+
+
+ +

This would turn off all filtering for these sites. This is best put + in user.action, for local site exceptions. + Note that when a simple domain pattern is used by itself (without the + subsequent path portion), all sub-pages within that domain are included + automatically in the scope of the action.

+ +

Images that are inexplicably being blocked, may well be hitting the + "+filter{banners-by-size}" rule, which assumes that + images of certain sizes are ad banners (works well most of the time since these tend to be + standardized).

+ +

"{ fragile }" is + an alias that disables most actions that are the most likely to cause + trouble. This can be used as a last resort for problem sites.

+ + + +
+
+
 { fragile }
  # Handle with care: easy to break
  mail.google.
- mybank.example.com

Remember to flush caches! Note that the - mail.google reference lacks the TLD portion (e.g. - ".com"). This will effectively match any TLD with - google in it, such as mail.google.de., - just as an example.

- If this still does not work, you will have to go through the remaining - actions one by one to find which one(s) is causing the problem.


PrevHome 
See Also  
+ mybank.example.com +
+
+ +

Remember to flush caches! + Note that the mail.google reference lacks the + TLD portion (e.g. ".com"). This will + effectively match any TLD with google in it, + such as mail.google.de., just as an + example.

+ +

If this still does not work, you will have to go through the + remaining actions one by one to find which one(s) is causing the + problem.

+
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/config.html privoxy-3.0.19/doc/webserver/user-manual/config.html --- privoxy-3.0.17/doc/webserver/user-manual/config.html 2010-11-13 12:51:20.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/config.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,1382 +1,842 @@ - -The Main Configuration File - -
Privoxy 3.0.17 User Manual
PrevNext

7. The Main Configuration File

Again, the main configuration file is named config on - Linux/Unix/BSD and OS/2, and config.txt on Windows. - Configuration lines consist of an initial keyword followed by a list of - values, all separated by whitespace (any number of spaces or tabs). For - example:

  confdir /etc/privoxy

-

Assigns the value /etc/privoxy to the option - confdir and thus indicates that the configuration - directory is named "/etc/privoxy/".

All options in the config file except for confdir and - logdir are optional. Watch out in the below description - for what happens if you leave them unset.

The main config file controls all aspects of Privoxy's - operation that are not location dependent (i.e. they apply universally, no matter - where you may be surfing). Like the filter and action files, the config file is - a plain text file and can be modified with a text editor like emacs, vim or - notepad.exe.

7.1. Local Set-up Documentation

If you intend to operate Privoxy for more users - than just yourself, it might be a good idea to let them know how to reach - you, what you block and why you do that, your policies, etc. -

7.1.1. user-manual

Specifies:

Location of the Privoxy User Manual. -

Type of value:

A fully qualified URI

Default value:

Unset

Effect if unset:

http://www.privoxy.org/version/user-manual/ - will be used, where version is the Privoxy version. -

Notes:

The User Manual URI is the single best source of information on - Privoxy, and is used for help links from some - of the internal CGI pages. The manual itself is normally packaged with the - binary distributions, so you probably want to set this to a locally - installed copy. -

Examples: -

The best all purpose solution is simply to put the full local - PATH to where the User Manual is - located: -

  user-manual  /usr/share/doc/privoxy/user-manual
-

The User Manual is then available to anyone with access to - Privoxy, by following the built-in URL: - http://config.privoxy.org/user-manual/ - (or the shortcut: http://p.p/user-manual/). -

If the documentation is not on the local system, it can be accessed - from a remote server, as: -

  user-manual  http://example.com/privoxy/user-manual/
-

Warning

If set, this option should be the first option in the config - file, because it is used while the config file is being read - on start-up. -

7.1.2. trust-info-url

Specifies:

A URL to be displayed in the error page that users will see if access to an untrusted page is denied. -

Type of value:

URL

Default value:

Unset

Effect if unset:

No links are displayed on the "untrusted" error page. -

Notes:

The value of this option only matters if the experimental trust mechanism has been - activated. (See trustfile below.) -

If you use the trust mechanism, it is a good idea to write up some on-line - documentation about your trust policy and to specify the URL(s) here. - Use multiple times for multiple URLs. -

The URL(s) should be added to the trustfile as well, so users don't end up - locked out from the information on why they were locked out in the first place! -

7.1.3. admin-address

Specifies:

An email address to reach the Privoxy administrator. -

Type of value:

Email address

Default value:

Unset

Effect if unset:

No email address is displayed on error pages and the CGI user interface. -

Notes:

If both admin-address and proxy-info-url - are unset, the whole "Local Privoxy Support" box on all generated pages will - not be shown. -

7.1.4. proxy-info-url

Specifies:

A URL to documentation about the local Privoxy setup, - configuration or policies. -

Type of value:

URL

Default value:

Unset

Effect if unset:

No link to local documentation is displayed on error pages and the CGI user interface. -

Notes:

If both admin-address and proxy-info-url - are unset, the whole "Local Privoxy Support" box on all generated pages will - not be shown. -

This URL shouldn't be blocked ;-) -

7.2. Configuration and Log File Locations

Privoxy can (and normally does) use a number of - other files for additional configuration, help and logging. - This section of the configuration file tells Privoxy - where to find those other files.

The user running Privoxy, must have read - permission for all configuration files, and write permission to any files - that would be modified, such as log files and actions files.

7.2.1. confdir

Specifies:

The directory where the other configuration files are located.

Type of value:

Path name

Default value:

/etc/privoxy (Unix) or Privoxy installation dir (Windows)

Effect if unset:

Mandatory

Notes:

No trailing "/", please. -

7.2.2. templdir

Specifies:

An alternative directory where the templates are loaded from.

Type of value:

Path name

Default value:

unset

Effect if unset:

The templates are assumed to be located in confdir/template.

Notes:

Privoxy's original templates are usually - overwritten with each update. Use this option to relocate customized - templates that should be kept. As template variables might change - between updates, you shouldn't expect templates to work with - Privoxy releases other than the one - they were part of, though. -

7.2.3. logdir

Specifies:

The directory where all logging takes place - (i.e. where the logfile is located). -

Type of value:

Path name

Default value:

/var/log/privoxy (Unix) or Privoxy installation dir (Windows)

Effect if unset:

Mandatory

Notes:

No trailing "/", please. -

7.2.4. actionsfile

Specifies:

The actions file(s) to use -

Type of value:

Complete file name, relative to confdir

Default values:

  match-all.action # Actions that are applied to all sites and maybe overruled later on.

-

  default.action   # Main actions file

-

  user.action      # User customizations

-

Effect if unset:

No actions are taken at all. More or less neutral proxying. -

Notes:

Multiple actionsfile lines are permitted, and are in fact recommended! -

- The default values are default.action, which is the - "main" actions file maintained by the developers, and - user.action, where you can make your personal additions. -

- Actions files contain all the per site and per URL configuration for - ad blocking, cookie management, privacy considerations, etc. - There is no point in using Privoxy without at - least one actions file. -

Note that since Privoxy 3.0.7, the complete filename, including the ".action" - extension has to be specified. The syntax change was necessary to be consistent - with the other file options and to allow previously forbidden characters. -

7.2.5. filterfile

Specifies:

The filter file(s) to use -

Type of value:

File name, relative to confdir

Default value:

default.filter (Unix) or default.filter.txt (Windows)

Effect if unset:

No textual content filtering takes place, i.e. all - +filter{name} - actions in the actions files are turned neutral. -

Notes:

Multiple filterfile lines are permitted. -

The filter files contain content modification - rules that use regular expressions. These rules permit - powerful changes on the content of Web pages, and optionally the headers - as well, e.g., you could try to disable your favorite JavaScript annoyances, - re-write the actual displayed text, or just have some fun - playing buzzword bingo with web pages. -

The - +filter{name} - actions rely on the relevant filter (name) - to be defined in a filter file! -

A pre-defined filter file called default.filter that contains - a number of useful filters for common problems is included in the distribution. - See the section on the filter - action for a list. -

It is recommended to place any locally adapted filters into a separate - file, such as user.filter. -

7.2.6. logfile

Specifies:

The log file to use -

Type of value:

File name, relative to logdir

Default value:

Unset (commented out). When activated: logfile (Unix) or privoxy.log (Windows).

Effect if unset:

No logfile is written. -

Notes:

The logfile is where all logging and error messages are written. The level - of detail and number of messages are set with the debug - option (see below). The logfile can be useful for tracking down a problem with - Privoxy (e.g., it's not blocking an ad you - think it should block) and it can help you to monitor what your browser - is doing. -

Depending on the debug options below, the logfile may be a privacy risk - if third parties can get access to it. As most users will never look - at it, Privoxy 3.0.7 and later only log fatal - errors by default. -

For most troubleshooting purposes, you will have to change that, - please refer to the debugging section for details. -

Your logfile will grow indefinitely, and you will probably want to - periodically remove it. On Unix systems, you can do this with a cron job - (see "man cron"). For Red Hat based Linux distributions, a - logrotate script has been included. -

Any log files must be writable by whatever user Privoxy - is being run as (on Unix, default user id is "privoxy"). -

7.2.7. trustfile

Specifies:

The name of the trust file to use -

Type of value:

File name, relative to confdir

Default value:

Unset (commented out). When activated: trust (Unix) or trust.txt (Windows)

Effect if unset:

The entire trust mechanism is disabled. -

Notes:

The trust mechanism is an experimental feature for building white-lists and should - be used with care. It is NOT recommended for the casual user. -

If you specify a trust file, Privoxy will only allow - access to sites that are specified in the trustfile. Sites can be listed - in one of two ways: -

Prepending a ~ character limits access to this site - only (and any sub-paths within this site), e.g. - ~www.example.com allows access to - ~www.example.com/features/news.html, etc. -

Or, you can designate sites as trusted referrers, by - prepending the name with a + character. The effect is that - access to untrusted sites will be granted -- but only if a link from this - trusted referrer was used to get there. The link target will then be added - to the "trustfile" so that future, direct accesses will be - granted. Sites added via this mechanism do not become trusted referrers - themselves (i.e. they are added with a ~ designation). - There is a limit of 512 such entries, after which new entries will not be - made. -

If you use the + operator in the trust file, it may grow - considerably over time. -

It is recommended that Privoxy be compiled with - the --disable-force, --disable-toggle and - --disable-editor options, if this feature is to be - used. -

Possible applications include limiting Internet access for children. -

7.3. Debugging

These options are mainly useful when tracing a problem. - Note that you might also want to invoke - Privoxy with the --no-daemon - command line option when debugging. -

7.3.1. debug

Specifies:

Key values that determine what information gets logged. -

Type of value:

Integer values

Default value:

0 (i.e.: only fatal errors (that cause Privoxy to exit) are logged)

Effect if unset:

Default value is used (see above). -

Notes:

The available debug levels are: -

  debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.
+
+
+
+
+  
+
+  The Main Configuration File
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

7. The Main Configuration + File

+ +

By default, the main configuration file is named config, with the exception of Windows, where it is named + config.txt. Configuration lines consist of an + initial keyword followed by a list of values, all separated by whitespace + (any number of spaces or tabs). For example:

+ +

  confdir /etc/privoxy

+ +

Assigns the value /etc/privoxy to the option + confdir and thus indicates that the + configuration directory is named "/etc/privoxy/".

+ +

All options in the config file except for confdir and logdir are optional. + Watch out in the below description for what happens if you leave them + unset.

+ +

The main config file controls all aspects of Privoxy's operation that are not location dependent + (i.e. they apply universally, no matter where you may be surfing). Like + the filter and action files, the config file is a plain text file and can + be modified with a text editor like emacs, vim or notepad.exe.

+ +
+

7.1. Local + Set-up Documentation

+ +

If you intend to operate Privoxy + for more users than just yourself, it might be a good idea to let them + know how to reach you, what you block and why you do that, your + policies, etc.

+ +
+

7.1.1. + user-manual

+ +
+
+
Specifies:
+ +
+

Location of the Privoxy + User Manual.

+
+ +
Type of value:
+ +
+

A fully qualified URI

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

http://www.privoxy.org/version/user-manual/ will be used, + where version is the + Privoxy version.

+
+ +
Notes:
+ +
+

The User Manual URI is the single best source of information + on Privoxy, and is used for + help links from some of the internal CGI pages. The manual + itself is normally packaged with the binary distributions, so + you probably want to set this to a locally installed copy.

+ +

Examples:

+ +

The best all purpose solution is simply to put the full + local PATH to where the User Manual is located:

+ + + + + +
+
+  user-manual  /usr/share/doc/privoxy/user-manual
+
+
+ +

The User Manual is then available to anyone with access to + Privoxy, by following the + built-in URL: http://config.privoxy.org/user-manual/ (or the + shortcut: http://p.p/user-manual/).

+ +

If the documentation is not on the local system, it can be + accessed from a remote server, as:

+ + + + + +
+
+  user-manual  http://example.com/privoxy/user-manual/
+
+
+ +
+ + + + + + + + +
Warning
+

If set, this option should be the first option in the config + file, because it is used while the config file + is being read on start-up.

+
+
+
+
+
+
+ +
+

7.1.2. + trust-info-url

+ +
+
+
Specifies:
+ +
+

A URL to be displayed in the error page that users will see + if access to an untrusted page is denied.

+
+ +
Type of value:
+ +
+

URL

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

No links are displayed on the "untrusted" error page.

+
+ +
Notes:
+ +
+

The value of this option only matters if the experimental + trust mechanism has been activated. (See trustfile below.)

+ +

If you use the trust mechanism, it is a good idea to write + up some on-line documentation about your trust policy and to + specify the URL(s) here. Use multiple times for multiple + URLs.

+ +

The URL(s) should be added to the trustfile as well, so + users don't end up locked out from the information on why they + were locked out in the first place!

+
+
+
+
+ +
+

7.1.3. + admin-address

+ +
+
+
Specifies:
+ +
+

An email address to reach the Privoxy administrator.

+
+ +
Type of value:
+ +
+

Email address

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

No email address is displayed on error pages and the CGI + user interface.

+
+ +
Notes:
+ +
+

If both admin-address and + proxy-info-url are unset, the whole + "Local Privoxy Support" box on all generated pages will not be + shown.

+
+
+
+
+ +
+

7.1.4. + proxy-info-url

+ +
+
+
Specifies:
+ +
+

A URL to documentation about the local Privoxy setup, configuration or + policies.

+
+ +
Type of value:
+ +
+

URL

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

No link to local documentation is displayed on error pages + and the CGI user interface.

+
+ +
Notes:
+ +
+

If both admin-address and + proxy-info-url are unset, the whole + "Local Privoxy Support" box on all generated pages will not be + shown.

+ +

This URL shouldn't be blocked ;-)

+
+
+
+
+
+ +
+

7.2. + Configuration and Log File Locations

+ +

Privoxy can (and normally does) use + a number of other files for additional configuration, help and logging. + This section of the configuration file tells Privoxy where to find those other files.

+ +

The user running Privoxy, must have + read permission for all configuration files, and write permission to + any files that would be modified, such as log files and actions + files.

+ +
+

7.2.1. + confdir

+ +
+
+
Specifies:
+ +
+

The directory where the other configuration files are + located.

+
+ +
Type of value:
+ +
+

Path name

+
+ +
Default value:
+ +
+

/etc/privoxy (Unix) or Privoxy installation dir (Windows)

+
+ +
Effect if unset:
+ +
+

Mandatory

+
+ +
Notes:
+ +
+

No trailing "/", please.

+
+
+
+
+ +
+

7.2.2. + templdir

+ +
+
+
Specifies:
+ +
+

An alternative directory where the templates are loaded + from.

+
+ +
Type of value:
+ +
+

Path name

+
+ +
Default value:
+ +
+

unset

+
+ +
Effect if unset:
+ +
+

The templates are assumed to be located in + confdir/template.

+
+ +
Notes:
+ +
+

Privoxy's original + templates are usually overwritten with each update. Use this + option to relocate customized templates that should be kept. As + template variables might change between updates, you shouldn't + expect templates to work with Privoxy releases other than the one they + were part of, though.

+
+
+
+
+ +
+

7.2.3. logdir

+ +
+
+
Specifies:
+ +
+

The directory where all logging takes place (i.e. where the + logfile is located).

+
+ +
Type of value:
+ +
+

Path name

+
+ +
Default value:
+ +
+

/var/log/privoxy (Unix) or Privoxy installation dir (Windows)

+
+ +
Effect if unset:
+ +
+

Mandatory

+
+ +
Notes:
+ +
+

No trailing "/", please.

+
+
+
+
+ +
+

7.2.4. + actionsfile

+ +
+
+
Specifies:
+ +
+

The actions file(s) to + use

+
+ +
Type of value:
+ +
+

Complete file name, relative to confdir

+
+ +
Default values:
+ +
+ + + + + + + + + + + + + + +
+

+   match-all.action # Actions that are applied to all sites and maybe overruled later on.

+
+

+   default.action   # Main actions file

+
+

+   user.action      # User customizations

+
+
+ +
Effect if unset:
+ +
+

No actions are taken at all. More or less neutral + proxying.

+
+ +
Notes:
+ +
+

Multiple actionsfile lines are + permitted, and are in fact recommended!

+ +

The default values are default.action, which is the "main" actions file maintained by the + developers, and user.action, where + you can make your personal additions.

+ +

Actions files contain all the per site and per URL + configuration for ad blocking, cookie management, privacy + considerations, etc. There is no point in using Privoxy without at least one actions + file.

+ +

Note that since Privoxy 3.0.7, the complete filename, + including the ".action" extension + has to be specified. The syntax change was necessary to be + consistent with the other file options and to allow previously + forbidden characters.

+
+
+
+
+ +
+

7.2.5. + filterfile

+ +
+
+
Specifies:
+ +
+

The filter file(s) to use

+
+ +
Type of value:
+ +
+

File name, relative to confdir

+
+ +
Default value:
+ +
+

default.filter (Unix) or default.filter.txt + (Windows)

+
+ +
Effect if unset:
+ +
+

No textual content filtering takes place, i.e. all + +filter{name} actions in the actions files + are turned neutral.

+
+ +
Notes:
+ +
+

Multiple filterfile lines are + permitted.

+ +

The filter files contain + content modification rules that use regular expressions. These rules + permit powerful changes on the content of Web pages, and + optionally the headers as well, e.g., you could try to disable + your favorite JavaScript annoyances, re-write the actual + displayed text, or just have some fun playing buzzword bingo + with web pages.

+ +

The +filter{name} actions rely on the relevant + filter (name) to be defined in + a filter file!

+ +

A pre-defined filter file called default.filter that contains a number of useful + filters for common problems is included in the distribution. + See the section on the filter action for a + list.

+ +

It is recommended to place any locally adapted filters into + a separate file, such as user.filter.

+
+
+
+
+ +
+

7.2.6. + logfile

+ +
+
+
Specifies:
+ +
+

The log file to use

+
+ +
Type of value:
+ +
+

File name, relative to logdir

+
+ +
Default value:
+ +
+

Unset (commented + out). When activated: logfile (Unix) or privoxy.log (Windows).

+
+ +
Effect if unset:
+ +
+

No logfile is written.

+
+ +
Notes:
+ +
+

The logfile is where all logging and error messages are + written. The level of detail and number of messages are set + with the debug option (see below). The + logfile can be useful for tracking down a problem with + Privoxy (e.g., it's not + blocking an ad you think it should block) and it can help you + to monitor what your browser is doing.

+ +

Depending on the debug options below, the logfile may be a + privacy risk if third parties can get access to it. As most + users will never look at it, Privoxy 3.0.7 and later only log fatal + errors by default.

+ +

For most troubleshooting purposes, you will have to change + that, please refer to the debugging section for details.

+ +

Your logfile will grow indefinitely, and you will probably + want to periodically remove it. On Unix systems, you can do + this with a cron job (see "man + cron"). For Red Hat based Linux distributions, a + logrotate script has been included.

+ +

Any log files must be writable by whatever user Privoxy is being run as (on Unix, default + user id is "privoxy").

+
+
+
+
+ +
+

7.2.7. + trustfile

+ +
+
+
Specifies:
+ +
+

The name of the trust file to use

+
+ +
Type of value:
+ +
+

File name, relative to confdir

+
+ +
Default value:
+ +
+

Unset (commented + out). When activated: trust (Unix) or trust.txt (Windows)

+
+ +
Effect if unset:
+ +
+

The entire trust mechanism is disabled.

+
+ +
Notes:
+ +
+

The trust mechanism is an experimental feature for building + white-lists and should be used with care. It is NOT recommended for the casual + user.

+ +

If you specify a trust file, Privoxy will only allow access to sites + that are specified in the trustfile. Sites can be listed in one + of two ways:

+ +

Prepending a ~ character limits + access to this site only (and any sub-paths within this site), + e.g. ~www.example.com allows access to + ~www.example.com/features/news.html, + etc.

+ +

Or, you can designate sites as trusted referrers, by prepending + the name with a + character. The + effect is that access to untrusted sites will be granted -- but + only if a link from this trusted referrer was used to get + there. The link target will then be added to the "trustfile" so that future, direct accesses will + be granted. Sites added via this mechanism do not become + trusted referrers themselves (i.e. they are added with a + ~ designation). There is a limit of + 512 such entries, after which new entries will not be made.

+ +

If you use the + operator in the + trust file, it may grow considerably over time.

+ +

It is recommended that Privoxy be compiled with the --disable-force, --disable-toggle and --disable-editor options, if this feature is to + be used.

+ +

Possible applications include limiting Internet access for + children.

+
+
+
+
+
+ +
+

7.3. + Debugging

+ +

These options are mainly useful when tracing a problem. Note that + you might also want to invoke Privoxy + with the --no-daemon command line option when + debugging.

+ +
+

7.3.1. debug

+ +
+
+
Specifies:
+ +
+

Key values that determine what information gets logged.

+
+ +
Type of value:
+ +
+

Integer values

+
+ +
Default value:
+ +
+

0 (i.e.: only fatal errors (that cause Privoxy to exit) are + logged)

+
+ +
Effect if unset:
+ +
+

Default value is used (see above).

+
+ +
Notes:
+ +
+

The available debug levels are:

+ + + +
+
+  debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.
   debug     2 # show each connection status
   debug     4 # show I/O status
   debug     8 # show header parsing
@@ -1386,3440 +846,2206 @@
   debug   128 # debug redirects
   debug   256 # debug GIF de-animation
   debug   512 # Common Log Format
-  debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
+  debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
   debug  2048 # CGI user interface
   debug  4096 # Startup banner and warnings.
   debug  8192 # Non-fatal errors
-  debug 32768 # log all data read from the network
-

To select multiple debug levels, you can either add them or use - multiple debug lines. -

A debug level of 1 is informative because it will show you each request - as it happens. 1, 1024, 4096 and 8192 are recommended - so that you will notice when things go wrong. The other levels are - probably only of interest if you are hunting down a specific problem. - They can produce a hell of an output (especially 16). - -

Privoxy used to ship with the debug levels recommended above enabled by - default, but due to privacy concerns 3.0.7 and later are configured to - only log fatal errors. -

If you are used to the more verbose settings, simply enable the debug lines - below again. -

If you want to use pure CLF (Common Log Format), you should set "debug - 512" ONLY and not enable anything else. -

Privoxy has a hard-coded limit for the - length of log messages. If it's reached, messages are logged truncated - and marked with "... [too long, truncated]". -

Please don't file any support requests without trying to reproduce - the problem with increased debug level first. Once you read the log - messages, you may even be able to solve the problem on your own. -

7.3.2. single-threaded

Specifies:

Whether to run only one server thread. -

Type of value:

None

Default value:

Unset

Effect if unset:

Multi-threaded (or, where unavailable: forked) operation, i.e. the ability to - serve multiple requests simultaneously. -

Notes:

This option is only there for debugging purposes. - It will drastically reduce performance. -

7.3.3. hostname

Specifies:

The hostname shown on the CGI pages. -

Type of value:

Text

Default value:

Unset

Effect if unset:

The hostname provided by the operating system is used. -

Notes:

On some misconfigured systems resolving the hostname fails or - takes too much time and slows Privoxy down. Setting a fixed hostname - works around the problem. -

In other circumstances it might be desirable to show a hostname - other than the one returned by the operating system. For example - if the system has several different hostnames and you don't want - to use the first one. -

Note that Privoxy does not validate the specified hostname value. -

7.4. Access Control and Security

This section of the config file controls the security-relevant aspects - of Privoxy's configuration. -

7.4.1. listen-address

Specifies:

The IP address and TCP port on which Privoxy will - listen for client requests. -

Type of value:

[IP-Address]:Port

Default value:

127.0.0.1:8118

Effect if unset:

Bind to 127.0.0.1 (IPv4 localhost), port 8118. This is suitable and - recommended for home users who run Privoxy on - the same machine as their browser. -

Notes:

You will need to configure your browser(s) to this proxy address and port. -

If you already have another service running on port 8118, or if you want to - serve requests from other machines (e.g. on your local network) as well, you - will need to override the default. -

IPv6 addresses containing colons have to be quoted by brackets. -

If you leave out the IP address, Privoxy will - bind to all IPv4 interfaces (addresses) on your machine and may become reachable - from the Internet. In that case, consider using access control lists (ACL's, see below), and/or - a firewall. -

If you open Privoxy to untrusted users, you will - also want to make sure that the following actions are disabled: enable-edit-actions and - enable-remote-toggle -

Example:

Suppose you are running Privoxy on - a machine which has the address 192.168.0.1 on your local private network - (192.168.0.0) and has another outside connection with a different address. - You want it to serve requests from inside only: -

  listen-address  192.168.0.1:8118
-

Suppose you are running Privoxy on an - IPv6-capable machine and you want it to listen on the IPv6 address - of the loopback device: -

  listen-address [::1]:8118
-

7.4.2. toggle

Specifies:

Initial state of "toggle" status -

Type of value:

1 or 0

Default value:

1

Effect if unset:

Act as if toggled on -

Notes:

If set to 0, Privoxy will start in - "toggled off" mode, i.e. mostly behave like a normal, - content-neutral proxy with both ad blocking and content filtering - disabled. See enable-remote-toggle below. -

The windows version will only display the toggle icon in the system tray - if this option is present. -

7.4.3. enable-remote-toggle

Specifies:

Whether or not the web-based toggle - feature may be used -

Type of value:

0 or 1

Default value:

0

Effect if unset:

The web-based toggle feature is disabled. -

Notes:

When toggled off, Privoxy mostly acts like a normal, - content-neutral proxy, i.e. doesn't block ads or filter content. -

Access to the toggle feature can not be - controlled separately by "ACLs" or HTTP authentication, - so that everybody who can access Privoxy (see - "ACLs" and listen-address above) can - toggle it for all users. So this option is not recommended - for multi-user environments with untrusted users. -

Note that malicious client side code (e.g Java) is also - capable of using this option. -

As a lot of Privoxy users don't read - documentation, this feature is disabled by default. -

Note that you must have compiled Privoxy with - support for this feature, otherwise this option has no effect. -

7.4.4. enable-remote-http-toggle

Specifies:

Whether or not Privoxy recognizes special HTTP headers to change its behaviour. -

Type of value:

0 or 1

Default value:

0

Effect if unset:

Privoxy ignores special HTTP headers. -

Notes:

When toggled on, the client can change Privoxy's - behaviour by setting special HTTP headers. Currently the only supported - special header is "X-Filter: No", to disable filtering for - the ongoing request, even if it is enabled in one of the action files. -

This feature is disabled by default. If you are using - Privoxy in a environment with trusted clients, - you may enable this feature at your discretion. Note that malicious client - side code (e.g Java) is also capable of using this feature. -

This option will be removed in future releases as it has been obsoleted - by the more general header taggers. -

7.4.5. enable-edit-actions

Specifies:

Whether or not the web-based actions - file editor may be used -

Type of value:

0 or 1

Default value:

0

Effect if unset:

The web-based actions file editor is disabled. -

Notes:

Access to the editor can not be - controlled separately by "ACLs" or HTTP authentication, - so that everybody who can access Privoxy (see - "ACLs" and listen-address above) can - modify its configuration for all users. -

This option is not recommended for environments - with untrusted users and as a lot of Privoxy - users don't read documentation, this feature is disabled by default. -

Note that malicious client side code (e.g Java) is also - capable of using the actions editor and you shouldn't enable - this options unless you understand the consequences and are - sure your browser is configured correctly. -

Note that you must have compiled Privoxy with - support for this feature, otherwise this option has no effect. -

7.4.6. enforce-blocks

Specifies:

Whether the user is allowed to ignore blocks and can "go there anyway". -

Type of value:

0 or 1 -

Default value:

0

Effect if unset:

Blocks are not enforced. -

Notes:

Privoxy is mainly used to block and filter - requests as a service to the user, for example to block ads and other - junk that clogs the pipes. Privoxy's configuration - isn't perfect and sometimes innocent pages are blocked. In this situation it - makes sense to allow the user to enforce the request and have - Privoxy ignore the block. -

In the default configuration Privoxy's - "Blocked" page contains a "go there anyway" - link to adds a special string (the force prefix) to the request URL. - If that link is used, Privoxy will - detect the force prefix, remove it again and let the request pass. -

Of course Privoxy can also be used to enforce - a network policy. In that case the user obviously should not be able to - bypass any blocks, and that's what the "enforce-blocks" - option is for. If it's enabled, Privoxy hides - the "go there anyway" link. If the user adds the force - prefix by hand, it will not be accepted and the circumvention attempt - is logged. -

Examples:

enforce-blocks 1 -

7.4.7. ACLs: permit-access and deny-access

Specifies:

Who can access what. -

Type of value:

src_addr[:port][/src_masklen] - [dst_addr[:port][/dst_masklen]] -

Where src_addr and - dst_addr are IPv4 addresses in dotted decimal notation or valid - DNS names, port is a port - number, and src_masklen and - dst_masklen are subnet masks in CIDR notation, i.e. integer - values from 2 to 30 representing the length (in bits) of the network address. The masks and the whole - destination part are optional. -

If your system implements - RFC 3493, then - src_addr and dst_addr can be IPv6 addresses delimeted by - brackets, port can be a number - or a service name, and - src_masklen and - dst_masklen can be a number - from 0 to 128. -

Default value:

Unset

If no port is specified, - any port will match. If no src_masklen or - src_masklen is given, the complete IP - address has to match (i.e. 32 bits for IPv4 and 128 bits for IPv6). -

Effect if unset:

Don't restrict access further than implied by listen-address -

Notes:

Access controls are included at the request of ISPs and systems - administrators, and are not usually needed by individual users. - For a typical home user, it will normally suffice to ensure that - Privoxy only listens on the localhost - (127.0.0.1) or internal (home) network address by means of the - listen-address - option. -

Please see the warnings in the FAQ that Privoxy - is not intended to be a substitute for a firewall or to encourage anyone - to defer addressing basic security weaknesses. -

Multiple ACL lines are OK. - If any ACLs are specified, Privoxy only talks - to IP addresses that match at least one permit-access line - and don't match any subsequent deny-access line. In other words, the - last match wins, with the default being deny-access. -

If Privoxy is using a forwarder (see forward below) - for a particular destination URL, the dst_addr - that is examined is the address of the forwarder and NOT the address - of the ultimate target. This is necessary because it may be impossible for the local - Privoxy to determine the IP address of the - ultimate target (that's often what gateways are used for). -

You should prefer using IP addresses over DNS names, because the address lookups take - time. All DNS names must resolve! You can not use domain patterns - like "*.org" or partial domain names. If a DNS name resolves to multiple - IP addresses, only the first one is used. -

Some systems allow IPv4 clients to connect to IPv6 server sockets. - Then the client's IPv4 address will be translated by the system into - IPv6 address space with special prefix ::ffff:0:0/96 (so called IPv4 - mapped IPv6 address). Privoxy can handle it - and maps such ACL addresses automatically. -

Denying access to particular sites by ACL may have undesired side effects - if the site in question is hosted on a machine which also hosts other sites - (most sites are). -

Examples:

Explicitly define the default behavior if no ACL and - listen-address are set: "localhost" - is OK. The absence of a dst_addr implies that - all destination addresses are OK: -

  permit-access  localhost
-

Allow any host on the same class C subnet as www.privoxy.org access to - nothing but www.example.com (or other domains hosted on the same system): -

  permit-access  www.privoxy.org/24 www.example.com/32
-

Allow access from any host on the 26-bit subnet 192.168.45.64 to anywhere, - with the exception that 192.168.45.73 may not access the IP address behind - www.dirty-stuff.example.com: -

  permit-access  192.168.45.64/26
-  deny-access    192.168.45.73    www.dirty-stuff.example.com
-

Allow access from the IPv4 network 192.0.2.0/24 even if listening on - an IPv6 wild card address (not supported on all platforms): -

  permit-access  192.0.2.0/24
-

This is equivalent to the following line even if listening on an - IPv4 address (not supported on all platforms): -

  permit-access  [::ffff:192.0.2.0]/120
-

7.4.8. buffer-limit

Specifies:

Maximum size of the buffer for content filtering. -

Type of value:

Size in Kbytes

Default value:

4096

Effect if unset:

Use a 4MB (4096 KB) limit. -

Notes:

For content filtering, i.e. the +filter and - +deanimate-gif actions, it is necessary that - Privoxy buffers the entire document body. - This can be potentially dangerous, since a server could just keep sending - data indefinitely and wait for your RAM to exhaust -- with nasty consequences. - Hence this option. -

When a document buffer size reaches the buffer-limit, it is - flushed to the client unfiltered and no further attempt to - filter the rest of the document is made. Remember that there may be multiple threads - running, which might require up to buffer-limit Kbytes - each, unless you have enabled "single-threaded" - above. -

7.5. Forwarding

This feature allows routing of HTTP requests through a chain of - multiple proxies.

Forwarding can be used to chain Privoxy with a caching proxy to speed - up browsing. Using a parent proxy may also be necessary if the machine - that Privoxy runs on has no direct Internet access.

Note that parent proxies can severely decrease your privacy level. - For example a parent proxy could add your IP address to the request - headers and if it's a caching proxy it may add the "Etag" - header to revalidation requests again, even though you configured Privoxy - to remove it. It may also ignore Privoxy's header time randomization and use the - original values which could be used by the server as cookie replacement - to track your steps between visits.

Also specified here are SOCKS proxies. Privoxy - supports the SOCKS 4 and SOCKS 4A protocols.

7.5.1. forward

Specifies:

To which parent HTTP proxy specific requests should be routed. -

Type of value:

target_pattern - http_parent[:port] -

where target_pattern is a URL pattern - that specifies to which requests (i.e. URLs) this forward rule shall apply. Use / to - denote "all URLs". - http_parent[:port] - is the DNS name or IP address of the parent HTTP proxy through which the requests should be forwarded, - optionally followed by its listening port (default: 8000). - Use a single dot (.) to denote "no forwarding". -

Default value:

Unset

Effect if unset:

Don't use parent HTTP proxies. -

Notes:

If http_parent is ".", then requests are not - forwarded to another HTTP proxy but are made directly to the web servers. -

http_parent can be a - numerical IPv6 address (if - RFC 3493 is - implemented). To prevent clashes with the port delimiter, the whole IP - address has to be put into brackets. On the other hand a target_pattern containing an IPv6 address - has to be put into angle brackets (normal brackets are reserved for - regular expressions already). -

Multiple lines are OK, they are checked in sequence, and the last match wins. -

Examples:

Everything goes to an example parent proxy, except SSL on port 443 (which it doesn't handle): -

  forward   /      parent-proxy.example.org:8080
-  forward   :443   .
-

Everything goes to our example ISP's caching proxy, except for requests - to that ISP's sites: -

  forward   /                  caching-proxy.isp.example.net:8000
-  forward   .isp.example.net   .
-

Parent proxy specified by an IPv6 address: -

  foward   /                   [2001:DB8::1]:8000
-

Suppose your parent proxy doesn't support IPv6: -

  forward  /                        parent-proxy.example.org:8000
-  forward  ipv6-server.example.org  .
-  forward  <[2-3][0-9a-f][0-9a-f][0-9a-f]:*>   .
-

7.5.2. forward-socks4, forward-socks4a and forward-socks5

Specifies:

Through which SOCKS proxy (and optionally to which parent HTTP proxy) specific requests should be routed. -

Type of value:

target_pattern - socks_proxy[:port] - http_parent[:port] -

where target_pattern is a - URL pattern that specifies to which - requests (i.e. URLs) this forward rule shall apply. Use / to - denote "all URLs". http_parent - and socks_proxy - are IP addresses in dotted decimal notation or valid DNS names - (http_parent - may be "." to denote "no HTTP forwarding"), and the optional - port parameters are TCP ports, - i.e. integer values from 1 to 65535 -

Default value:

Unset

Effect if unset:

Don't use SOCKS proxies. -

Notes:

Multiple lines are OK, they are checked in sequence, and the last match wins. -

The difference between forward-socks4 and forward-socks4a - is that in the SOCKS 4A protocol, the DNS resolution of the target hostname happens on the SOCKS - server, while in SOCKS 4 it happens locally. -

With forward-socks5 the DNS resolution will happen on the remote server as well. -

socks_proxy and - http_parent can be a - numerical IPv6 address (if - RFC 3493 is - implemented). To prevent clashes with the port delimiter, the whole IP - address has to be put into brackets. On the other hand a target_pattern containing an IPv6 address - has to be put into angle brackets (normal brackets are reserved for - regular expressions already). -

If http_parent is ".", then requests are not - forwarded to another HTTP proxy but are made (HTTP-wise) directly to the web servers, albeit through - a SOCKS proxy. -

Examples:

From the company example.com, direct connections are made to all - "internal" domains, but everything outbound goes through - their ISP's proxy by way of example.com's corporate SOCKS 4A gateway to - the Internet. -

  forward-socks4a   /              socks-gw.example.com:1080  www-cache.isp.example.net:8080
-  forward           .example.com   .
-

A rule that uses a SOCKS 4 gateway for all destinations but no HTTP parent looks like this: -

  forward-socks4   /               socks-gw.example.com:1080  .
-

To chain Privoxy and Tor, both running on the same system, you would use - something like: -

  forward-socks5   /               127.0.0.1:9050 .
-

The public Tor network can't be used to - reach your local network, if you need to access local servers you - therefore might want to make some exceptions: -

  forward         192.168.*.*/     .
-  forward            10.*.*.*/     .
-  forward           127.*.*.*/     .
-

Unencrypted connections to systems in these address ranges will - be as (un)secure as the local network is, but the alternative is that you - can't reach the local network through Privoxy - at all. Of course this may actually be desired and there is no reason - to make these exceptions if you aren't sure you need them. -

If you also want to be able to reach servers in your local network by - using their names, you will need additional exceptions that look like - this: -

 forward           localhost/     .
-

7.5.3. Advanced Forwarding Examples

If you have links to multiple ISPs that provide various special content - only to their subscribers, you can configure multiple Privoxies - which have connections to the respective ISPs to act as forwarders to each other, so that - your users can see the internal content of all ISPs.

Assume that host-a has a PPP connection to isp-a.example.net. And host-b has a PPP connection to - isp-b.example.org. Both run Privoxy. Their forwarding - configuration can look like this:

host-a:

  forward    /           .
-  forward    .isp-b.example.net  host-b:8118

host-b:

  forward    /           .
-  forward    .isp-a.example.org  host-a:8118

Now, your users can set their browser's proxy to use either - host-a or host-b and be able to browse the internal content - of both isp-a and isp-b.

If you intend to chain Privoxy and - squid locally, then chaining as - browser -> squid -> privoxy is the recommended way.

Assuming that Privoxy and squid - run on the same box, your squid configuration could then look like this:

+ +
  # Define Privoxy as parent proxy (without ICP) 
-  cache_peer 127.0.0.1 parent 8118 7 no-query 
+  debug 32768 # log all data read from the network
+
+
- # Define ACL for protocol FTP - acl ftp proto FTP +

To select multiple debug levels, you can either add them or + use multiple debug lines.

- # Do not forward FTP requests to Privoxy - always_direct allow ftp +

A debug level of 1 is informative because it will show you + each request as it happens. 1, 1024, 4096 and 8192 are + recommended so that you will notice when things go + wrong. The other levels are probably only of interest if you + are hunting down a specific problem. They can produce a hell of + an output (especially 16).

- # Forward all the rest to Privoxy - never_direct allow all

You would then need to change your browser's proxy settings to squid's address and port. - Squid normally uses port 3128. If unsure consult http_port in squid.conf.

You could just as well decide to only forward requests you suspect - of leading to Windows executables through a virus-scanning parent proxy, - say, on antivir.example.com, port 8010:

  forward   /                          .
-  forward   /.*\.(exe|com|dll|zip)$    antivir.example.com:8010

7.5.4. forwarded-connect-retries

Specifies:

How often Privoxy retries if a forwarded connection request fails. -

Type of value:

Number of retries. -

Default value:

0

Effect if unset:

Connections forwarded through other proxies are treated like direct connections and no retry attempts are made. -

Notes:

forwarded-connect-retries is mainly interesting - for socks4a connections, where Privoxy can't detect why the connections failed. - The connection might have failed because of a DNS timeout in which case a retry makes sense, - but it might also have failed because the server doesn't exist or isn't reachable. In this - case the retry will just delay the appearance of Privoxy's error message. -

Note that in the context of this option, "forwarded connections" includes all connections - that Privoxy forwards through other proxies. This option is not limited to the HTTP CONNECT method. -

Only use this option, if you are getting lots of forwarding-related error messages - that go away when you try again manually. Start with a small value and check Privoxy's - logfile from time to time, to see how many retries are usually needed. -

Due to a bug, this option currently also causes Privoxy to - retry in case of certain problems with direct connections. -

Examples:

forwarded-connect-retries 1 -

7.6. Miscellaneous

7.6.1. accept-intercepted-requests

Specifies:

Whether intercepted requests should be treated as valid. -

Type of value:

0 or 1 -

Default value:

0

Effect if unset:

Only proxy requests are accepted, intercepted requests are treated as invalid. -

Notes:

If you don't trust your clients and want to force them - to use Privoxy, enable this - option and configure your packet filter to redirect outgoing - HTTP connections into Privoxy. -

Make sure that Privoxy's own requests - aren't redirected as well. Additionally take care that - Privoxy can't intentionally connect - to itself, otherwise you could run into redirection loops if - Privoxy's listening port is reachable - by the outside or an attacker has access to the pages you visit. -

Examples:

accept-intercepted-requests 1 -

7.6.2. allow-cgi-request-crunching

Specifies:

Whether requests to Privoxy's CGI pages can be blocked or redirected. -

Type of value:

0 or 1 -

Default value:

0

Effect if unset:

Privoxy ignores block and redirect actions for its CGI pages. -

Notes:

By default Privoxy ignores block or redirect actions - for its CGI pages. Intercepting these requests can be useful in multi-user - setups to implement fine-grained access control, but it can also render the complete - web interface useless and make debugging problems painful if done without care. -

Don't enable this option unless you're sure that you really need it. -

Examples:

allow-cgi-request-crunching 1 -

7.6.3. split-large-forms

Specifies:

Whether the CGI interface should stay compatible with broken HTTP clients. -

Type of value:

0 or 1 -

Default value:

0

Effect if unset:

The CGI form generate long GET URLs. -

Notes:

Privoxy's CGI forms can lead to - rather long URLs. This isn't a problem as far as the HTTP - standard is concerned, but it can confuse clients with arbitrary - URL length limitations. -

Enabling split-large-forms causes Privoxy - to divide big forms into smaller ones to keep the URL length down. - It makes editing a lot less convenient and you can no longer - submit all changes at once, but at least it works around this - browser bug. -

If you don't notice any editing problems, there is no reason - to enable this option, but if one of the submit buttons appears - to be broken, you should give it a try. -

Examples:

split-large-forms 1 -

7.6.4. keep-alive-timeout

Specifies:

Number of seconds after which an open connection will no longer be reused. -

Type of value:

Time in seconds. -

Default value:

None

Effect if unset:

Connections are not kept alive. -

Notes:

This option allows clients to keep the connection to Privoxy - alive. If the server supports it, Privoxy will keep - the connection to the server alive as well. Under certain - circumstances this may result in speed-ups. -

By default, Privoxy will close the connection to the server if - the client connection gets closed, or if the specified timeout - has been reached without a new request coming in. This behaviour - can be changed with the connection-sharing option. -

This option has no effect if Privoxy - has been compiled without keep-alive support. -

Note that a timeout of five seconds as used in the default - configuration file significantly decreases the number of - connections that will be reused. The value is used because - some browsers limit the number of connections they open to - a single host and apply the same limit to proxies. This can - result in a single website "grabbing" all the - connections the browser allows, which means connections to - other websites can't be opened until the connections currently - in use time out. -

Several users have reported this as a Privoxy bug, so the - default value has been reduced. Consider increasing it to - 300 seconds or even more if you think your browser can handle - it. If your browser appears to be hanging it can't. -

Examples:

keep-alive-timeout 300 -

7.6.5. default-server-timeout

Specifies:

Assumed server-side keep-alive timeout if not specified by the server. -

Type of value:

Time in seconds. -

Default value:

None

Effect if unset:

Connections for which the server didn't specify the keep-alive - timeout are not reused. -

Notes:

Enabling this option significantly increases the number of connections - that are reused, provided the keep-alive-timeout option - is also enabled. -

While it also increases the number of connections problems - when Privoxy tries to reuse a connection that already has - been closed on the server side, or is closed while Privoxy - is trying to reuse it, this should only be a problem if it - happens for the first request sent by the client. If it happens - for requests on reused client connections, Privoxy will simply - close the connection and the client is supposed to retry the - request without bothering the user. -

Enabling this option is therefore only recommended if the - connection-sharing option - is disabled. -

It is an error to specify a value larger than the keep-alive-timeout value. -

This option has no effect if Privoxy - has been compiled without keep-alive support. -

Examples:

default-server-timeout 60 -

7.6.6. connection-sharing

Specifies:

Whether or not outgoing connections that have been kept alive - should be shared between different incoming connections. -

Type of value:

0 or 1 -

Default value:

None

Effect if unset:

Connections are not shared. -

Notes:

This option has no effect if Privoxy - has been compiled without keep-alive support, or if it's disabled. -

Notes:

Note that reusing connections doesn't necessary cause speedups. - There are also a few privacy implications you should be aware of. -

If this option is effective, outgoing connections are shared between - clients (if there are more than one) and closing the browser that initiated - the outgoing connection does no longer affect the connection between Privoxy - and the server unless the client's request hasn't been completed yet. -

If the outgoing connection is idle, it will not be closed until either - Privoxy's or the server's timeout is reached. - While it's open, the server knows that the system running Privoxy is still - there. -

If there are more than one client (maybe even belonging to multiple users), - they will be able to reuse each others connections. This is potentially - dangerous in case of authentication schemes like NTLM where only the - connection is authenticated, instead of requiring authentication for - each request. -

If there is only a single client, and if said client can keep connections - alive on its own, enabling this option has next to no effect. If the client - doesn't support connection keep-alive, enabling this option may make sense - as it allows Privoxy to keep outgoing connections alive even if the client - itself doesn't support it. -

You should also be aware that enabling this option increases the likelihood - of getting the "No server or forwarder data" error message, especially if you - are using a slow connection to the Internet. -

This option should only be used by experienced users who - understand the risks and can weight them against the benefits. -

Examples:

connection-sharing 1 -

7.6.7. socket-timeout

Specifies:

Number of seconds after which a socket times out if - no data is received. -

Type of value:

Time in seconds. -

Default value:

None

Effect if unset:

A default value of 300 seconds is used. -

Notes:

For SOCKS requests the timeout currently doesn't start until - the SOCKS server accepted the request. This will be fixed in - the next release. -

Examples:

socket-timeout 300 -

7.6.8. max-client-connections

Specifies:

Maximum number of client connections that will be served. -

Type of value:

Positive number. -

Default value:

None

Effect if unset:

Connections are served until a resource limit is reached. -

Notes:

Privoxy creates one thread (or process) for every incoming client - connection that isn't rejected based on the access control settings. -

If the system is powerful enough, Privoxy can theoretically deal with - several hundred (or thousand) connections at the same time, but some - operating systems enforce resource limits by shutting down offending - processes and their default limits may be below the ones Privoxy would - require under heavy load. -

Configuring Privoxy to enforce a connection limit below the thread - or process limit used by the operating system makes sure this doesn't - happen. Simply increasing the operating system's limit would work too, - but if Privoxy isn't the only application running on the system, - you may actually want to limit the resources used by Privoxy. -

If Privoxy is only used by a single trusted user, limiting the - number of client connections is probably unnecessary. If there - are multiple possibly untrusted users you probably still want to - additionally use a packet filter to limit the maximal number of - incoming connections per client. Otherwise a malicious user could - intentionally create a high number of connections to prevent other - users from using Privoxy. -

Obviously using this option only makes sense if you choose a limit - below the one enforced by the operating system. -

Examples:

max-client-connections 256 -

7.6.9. handle-as-empty-doc-returns-ok

Note:

This is a work-around for Firefox bug 492459: - " Websites are no longer rendered if SSL requests for JavaScripts are blocked by a proxy. - " - (https://bugzilla.mozilla.org/show_bug.cgi?id=492459) -

Specifies:

The status code Privoxy returns for pages blocked with - - +handle-as-empty-document. -

Type of value:

0 or 1 -

Default value:

0

Effect if unset:

Privoxy returns a status 403(forbidden) for all blocked pages. -

Effect if set:

Privoxy returns a status 200(OK) for pages blocked with +handle-as-empty-document - and a status 403(Forbidden) for all other blocked pages. -

7.7. Windows GUI Options

Privoxy has a number of options specific to the - Windows GUI interface:

If "activity-animation" is set to 1, the - Privoxy icon will animate when - "Privoxy" is active. To turn off, set to 0.

  activity-animation 1
-   

-

If "log-messages" is set to 1, - Privoxy will log messages to the console - window:

  log-messages 1
-   

-

- If "log-buffer-size" is set to 1, the size of the log buffer, - i.e. the amount of memory used for the log messages displayed in the - console window, will be limited to "log-max-lines" (see below).

Warning: Setting this to 0 will result in the buffer to grow infinitely and - eat up all your memory!

  log-buffer-size 1
-   

-

log-max-lines is the maximum number of lines held - in the log buffer. See above.

  log-max-lines 200
-   

-

If "log-highlight-messages" is set to 1, - Privoxy will highlight portions of the log - messages with a bold-faced font:

  log-highlight-messages 1
-   

-

The font used in the console window:

  log-font-name Comic Sans MS
-   

-

Font size used in the console window:

  log-font-size 8
-   

-

- "show-on-task-bar" controls whether or not - Privoxy will appear as a button on the Task bar - when minimized:

  show-on-task-bar 0
-   

-

If "close-button-minimizes" is set to 1, the Windows close - button will minimize Privoxy instead of closing - the program (close with the exit option on the File menu).

  close-button-minimizes 1
-   

-

The "hide-console" option is specific to the MS-Win console - version of Privoxy. If this option is used, - Privoxy will disconnect from and hide the - command console.

  #hide-console
-   

-


PrevHomeNext
Privoxy Configuration Actions Files
\ No newline at end of file +

Privoxy used to ship with + the debug levels recommended above enabled by default, but due + to privacy concerns 3.0.7 and later are configured to only log + fatal errors.

+ +

If you are used to the more verbose settings, simply enable + the debug lines below again.

+ +

If you want to use pure CLF (Common Log Format), you should + set "debug 512" ONLY and not enable anything + else.

+ +

Privoxy has a hard-coded + limit for the length of log messages. If it's reached, messages + are logged truncated and marked with "... + [too long, truncated]".

+ +

Please don't file any support requests without trying to + reproduce the problem with increased debug level first. Once + you read the log messages, you may even be able to solve the + problem on your own.

+ + +
+ + +
+

7.3.2. single-threaded

+ +
+
+
Specifies:
+ +
+

Whether to run only one server thread.

+
+ +
Type of value:
+ +
+

None

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

Multi-threaded (or, where unavailable: forked) operation, + i.e. the ability to serve multiple requests simultaneously.

+
+ +
Notes:
+ +
+

This option is only there for debugging purposes. + It will drastically reduce + performance.

+
+
+
+
+ +
+

7.3.3. + hostname

+ +
+
+
Specifies:
+ +
+

The hostname shown on the CGI pages.

+
+ +
Type of value:
+ +
+

Text

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

The hostname provided by the operating system is used.

+
+ +
Notes:
+ +
+

On some misconfigured systems resolving the hostname fails + or takes too much time and slows Privoxy down. Setting a fixed + hostname works around the problem.

+ +

In other circumstances it might be desirable to show a + hostname other than the one returned by the operating system. + For example if the system has several different hostnames and + you don't want to use the first one.

+ +

Note that Privoxy does not validate the specified hostname + value.

+
+
+
+
+ + +
+

7.4. + Access Control and Security

+ +

This section of the config file controls the security-relevant + aspects of Privoxy's + configuration.

+ +
+

7.4.1. + listen-address

+ +
+
+
Specifies:
+ +
+

The address and TCP port on which Privoxy will listen for client + requests.

+
+ +
Type of value:
+ +
+

[IP-Address]:Port

+ +

[Hostname]:Port

+
+ +
Default value:
+ +
+

127.0.0.1:8118

+
+ +
Effect if unset:
+ +
+

Bind to 127.0.0.1 (IPv4 localhost), port 8118. This is + suitable and recommended for home users who run Privoxy on the same machine as their + browser.

+
+ +
Notes:
+ +
+

You will need to configure your browser(s) to this proxy + address and port.

+ +

If you already have another service running on port 8118, or + if you want to serve requests from other machines (e.g. on your + local network) as well, you will need to override the + default.

+ +

You can use this statement multiple times to make + Privoxy listen on more ports + or more IP addresses. Suitable if + your operating system does not support sharing IPv6 and IPv4 + protocols on the same socket.

+ +

If a hostname is used instead of an IP address, Privoxy will try to resolve it to an IP + address and if there are multiple, use the first one + returned.

+ +

If the address for the hostname isn't already known on the + system (for example because it's in /etc/hostname), this may + result in DNS traffic.

+ +

If the specified address isn't available on the system, or + if the hostname can't be resolved, Privoxy will fail to start.

+ +

IPv6 addresses containing colons have to be quoted by + brackets. They can only be used if Privoxy has been compiled with IPv6 + support. If you aren't sure if your version supports it, have a + look at http://config.privoxy.org/show-status.

+ +

Some operating systems will prefer IPv6 to IPv4 addresses + even if the system has no IPv6 connectivity which is usually + not expected by the user. Some even rely on DNS to resolve + localhost which mean the "localhost" address used may not + actually be local.

+ +

It is therefore recommended to explicitly configure the + intended IP address instead of relying on the operating system, + unless there's a strong reason not to.

+ +

If you leave out the address, Privoxy will bind to all IPv4 interfaces + (addresses) on your machine and may become reachable from the + Internet and/or the local network. Be aware that some GNU/Linux + distributions modify that behaviour without updating the + documentation. Check for non-standard patches if your + Privoxyversion behaves + differently.

+ +

If you configure Privoxyto + be reachable from the network, consider using access control lists (ACL's, see below), + and/or a firewall.

+ +

If you open Privoxy to + untrusted users, you will also want to make sure that the + following actions are disabled: enable-edit-actions + and enable-remote-toggle

+ +

With the exception noted above, listening on multiple + addresses is currently not supported by Privoxy directly. It can be done on most + operating systems by letting a packet filter redirect request + for certain addresses to Privoxy, though.

+
+ +
Example:
+ +
+

Suppose you are running Privoxy on a machine which has the address + 192.168.0.1 on your local private network (192.168.0.0) and has + another outside connection with a different address. You want + it to serve requests from inside only:

+ + + + + +
+
+  listen-address  192.168.0.1:8118
+
+
+ +

Suppose you are running Privoxy on an IPv6-capable machine and you + want it to listen on the IPv6 address of the loopback + device:

+ + + + + +
+
+  listen-address [::1]:8118
+
+
+
+
+
+
+ +
+

7.4.2. toggle

+ +
+
+
Specifies:
+ +
+

Initial state of "toggle" status

+
+ +
Type of value:
+ +
+

1 or 0

+
+ +
Default value:
+ +
+

1

+
+ +
Effect if unset:
+ +
+

Act as if toggled on

+
+ +
Notes:
+ +
+

If set to 0, Privoxy will + start in "toggled off" mode, i.e. + mostly behave like a normal, content-neutral proxy with both ad + blocking and content filtering disabled. See enable-remote-toggle below.

+ +

The windows version will only display the toggle icon in the + system tray if this option is present.

+
+
+
+
+ +
+

7.4.3. enable-remote-toggle

+ +
+
+
Specifies:
+ +
+

Whether or not the web-based + toggle feature may be used

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

The web-based toggle feature is disabled.

+
+ +
Notes:
+ +
+

When toggled off, Privoxy + mostly acts like a normal, content-neutral proxy, i.e. doesn't + block ads or filter content.

+ +

Access to the toggle feature can not be controlled separately by + "ACLs" or HTTP authentication, so + that everybody who can access Privoxy (see "ACLs" and listen-address above) can toggle it for all + users. So this option is not + recommended for multi-user environments with untrusted + users.

+ +

Note that malicious client side code (e.g Java) is also + capable of using this option.

+ +

As a lot of Privoxy users + don't read documentation, this feature is disabled by + default.

+ +

Note that you must have compiled Privoxy with support for this feature, + otherwise this option has no effect.

+
+
+
+
+ +
+

7.4.4. enable-remote-http-toggle

+ +
+
+
Specifies:
+ +
+

Whether or not Privoxy recognizes special HTTP headers to + change its behaviour.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Privoxy ignores special HTTP headers.

+
+ +
Notes:
+ +
+

When toggled on, the client can change Privoxy's behaviour by setting special + HTTP headers. Currently the only supported special header is + "X-Filter: No", to disable filtering + for the ongoing request, even if it is enabled in one of the + action files.

+ +

This feature is disabled by default. If you are using + Privoxy in a environment with + trusted clients, you may enable this feature at your + discretion. Note that malicious client side code (e.g Java) is + also capable of using this feature.

+ +

This option will be removed in future releases as it has + been obsoleted by the more general header taggers.

+
+
+
+
+ +
+

7.4.5. enable-edit-actions

+ +
+
+
Specifies:
+ +
+

Whether or not the web-based + actions file editor may be used

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

The web-based actions file editor is disabled.

+
+ +
Notes:
+ +
+

Access to the editor can not be controlled separately by + "ACLs" or HTTP authentication, so + that everybody who can access Privoxy (see "ACLs" and listen-address above) can modify its + configuration for all users.

+ +

This option is not + recommended for environments with untrusted users and as + a lot of Privoxy users don't + read documentation, this feature is disabled by default.

+ +

Note that malicious client side code (e.g Java) is also + capable of using the actions editor and you shouldn't enable + this options unless you understand the consequences and are + sure your browser is configured correctly.

+ +

Note that you must have compiled Privoxy with support for this feature, + otherwise this option has no effect.

+
+
+
+
+ +
+

7.4.6. + enforce-blocks

+ +
+
+
Specifies:
+ +
+

Whether the user is allowed to ignore blocks and can + "go there anyway".

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Blocks are not enforced.

+
+ +
Notes:
+ +
+

Privoxy is mainly used to + block and filter requests as a service to the user, for example + to block ads and other junk that clogs the pipes. Privoxy's configuration isn't perfect and + sometimes innocent pages are blocked. In this situation it + makes sense to allow the user to enforce the request and have + Privoxy ignore the block.

+ +

In the default configuration Privoxy's "Blocked" page contains a "go there anyway" link to adds a special string + (the force prefix) to the request URL. If that link is used, + Privoxy will detect the force + prefix, remove it again and let the request pass.

+ +

Of course Privoxy can also + be used to enforce a network policy. In that case the user + obviously should not be able to bypass any blocks, and that's + what the "enforce-blocks" option is + for. If it's enabled, Privoxy + hides the "go there anyway" link. If + the user adds the force prefix by hand, it will not be accepted + and the circumvention attempt is logged.

+
+ +
Examples:
+ +
+

enforce-blocks 1

+
+
+
+
+ +
+

7.4.7. ACLs: permit-access + and deny-access

+ +
+
+
Specifies:
+ +
+

Who can access what.

+
+ +
Type of value:
+ +
+

src_addr[:port][/src_masklen] [dst_addr[:port][/dst_masklen]]

+ +

Where src_addr and + dst_addr are IPv4 addresses in + dotted decimal notation or valid DNS names, port is a port number, and src_masklen and dst_masklen are subnet masks in CIDR + notation, i.e. integer values from 2 to 30 representing the + length (in bits) of the network address. The masks and the + whole destination part are optional.

+ +

If your system implements RFC + 3493, then src_addr and + dst_addr can be IPv6 addresses + delimeted by brackets, port can + be a number or a service name, and src_masklen and dst_masklen can be a number from 0 to + 128.

+
+ +
Default value:
+ +
+

Unset

+ +

If no port is specified, any + port will match. If no src_masklen or src_masklen is given, the complete IP + address has to match (i.e. 32 bits for IPv4 and 128 bits for + IPv6).

+
+ +
Effect if unset:
+ +
+

Don't restrict access further than implied by listen-address

+
+ +
Notes:
+ +
+

Access controls are included at the request of ISPs and + systems administrators, and are not usually needed by individual + users. For a typical home user, it will normally suffice + to ensure that Privoxy only + listens on the localhost (127.0.0.1) or internal (home) network + address by means of the listen-address option.

+ +

Please see the warnings in the FAQ that Privoxy is not intended to be a substitute + for a firewall or to encourage anyone to defer addressing basic + security weaknesses.

+ +

Multiple ACL lines are OK. If any ACLs are specified, + Privoxy only talks to IP + addresses that match at least one permit-access line and don't match any + subsequent deny-access line. In other + words, the last match wins, with the default being deny-access.

+ +

If Privoxy is using a + forwarder (see forward below) for a + particular destination URL, the dst_addr that is examined is the address + of the forwarder and NOT the address of the ultimate + target. This is necessary because it may be impossible for the + local Privoxy to determine the + IP address of the ultimate target (that's often what gateways + are used for).

+ +

You should prefer using IP addresses over DNS names, because + the address lookups take time. All DNS names must resolve! You + can not use domain + patterns like "*.org" or partial + domain names. If a DNS name resolves to multiple IP addresses, + only the first one is used.

+ +

Some systems allow IPv4 clients to connect to IPv6 server + sockets. Then the client's IPv4 address will be translated by + the system into IPv6 address space with special prefix + ::ffff:0:0/96 (so called IPv4 mapped IPv6 address). + Privoxy can handle it and maps + such ACL addresses automatically.

+ +

Denying access to particular sites by ACL may have undesired + side effects if the site in question is hosted on a machine + which also hosts other sites (most sites are).

+
+ +
Examples:
+ +
+

Explicitly define the default behavior if no ACL and + listen-address are set: "localhost" is OK. The absence of a dst_addr implies that all destination addresses are + OK:

+ + + + + +
+
+  permit-access  localhost
+
+
+ +

Allow any host on the same class C subnet as www.privoxy.org + access to nothing but www.example.com (or other domains hosted + on the same system):

+ + + + + +
+
+  permit-access  www.privoxy.org/24 www.example.com/32
+
+
+ +

Allow access from any host on the 26-bit subnet + 192.168.45.64 to anywhere, with the exception that + 192.168.45.73 may not access the IP address behind + www.dirty-stuff.example.com:

+ + + + + +
+
+  permit-access  192.168.45.64/26
+  deny-access    192.168.45.73    www.dirty-stuff.example.com
+
+
+ +

Allow access from the IPv4 network 192.0.2.0/24 even if + listening on an IPv6 wild card address (not supported on all + platforms):

+ + + + + +
+
+  permit-access  192.0.2.0/24
+
+
+ +

This is equivalent to the following line even if listening + on an IPv4 address (not supported on all platforms):

+ + + + + +
+
+  permit-access  [::ffff:192.0.2.0]/120
+
+
+
+
+
+
+ +
+

7.4.8. + buffer-limit

+ +
+
+
Specifies:
+ +
+

Maximum size of the buffer for content filtering.

+
+ +
Type of value:
+ +
+

Size in Kbytes

+
+ +
Default value:
+ +
+

4096

+
+ +
Effect if unset:
+ +
+

Use a 4MB (4096 KB) limit.

+
+ +
Notes:
+ +
+

For content filtering, i.e. the +filter and +deanimate-gif actions, it is necessary that + Privoxy buffers the entire + document body. This can be potentially dangerous, since a + server could just keep sending data indefinitely and wait for + your RAM to exhaust -- with nasty consequences. Hence this + option.

+ +

When a document buffer size reaches the buffer-limit, it is flushed to the client + unfiltered and no further attempt to filter the rest of the + document is made. Remember that there may be multiple threads + running, which might require up to buffer-limit Kbytes each, unless you have enabled + "single-threaded" above.

+
+
+
+
+
+ +
+

7.5. + Forwarding

+ +

This feature allows routing of HTTP requests through a chain of + multiple proxies.

+ +

Forwarding can be used to chain Privoxy with a caching proxy to + speed up browsing. Using a parent proxy may also be necessary if the + machine that Privoxy runs on has no + direct Internet access.

+ +

Note that parent proxies can severely decrease your privacy level. + For example a parent proxy could add your IP address to the request + headers and if it's a caching proxy it may add the "Etag" header to revalidation requests again, even + though you configured Privoxy to remove it. It may also ignore + Privoxy's header time randomization and use the original values which + could be used by the server as cookie replacement to track your steps + between visits.

+ +

Also specified here are SOCKS proxies. Privoxy supports the SOCKS 4 and SOCKS 4A + protocols.

+ +
+

7.5.1. + forward

+ +
+
+
Specifies:
+ +
+

To which parent HTTP proxy specific requests should be + routed.

+
+ +
Type of value:
+ +
+

target_pattern http_parent[:port]

+ +

where target_pattern is a + URL pattern that + specifies to which requests (i.e. URLs) this forward rule shall + apply. Use / to denote "all URLs". http_parent[:port] is the DNS name or IP address of + the parent HTTP proxy through which the requests should be + forwarded, optionally followed by its listening port (default: + 8000). Use a single dot (.) to denote + "no forwarding".

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

Don't use parent HTTP proxies.

+
+ +
Notes:
+ +
+

If http_parent is + ".", then requests are not forwarded + to another HTTP proxy but are made directly to the web + servers.

+ +

http_parent can be a + numerical IPv6 address (if RFC 3493 + is implemented). To prevent clashes with the port delimiter, + the whole IP address has to be put into brackets. On the other + hand a target_pattern + containing an IPv6 address has to be put into angle brackets + (normal brackets are reserved for regular expressions + already).

+ +

Multiple lines are OK, they are checked in sequence, and the + last match wins.

+
+ +
Examples:
+ +
+

Everything goes to an example parent proxy, except SSL on + port 443 (which it doesn't handle):

+ + + + + +
+
+  forward   /      parent-proxy.example.org:8080
+  forward   :443   .
+
+
+ +

Everything goes to our example ISP's caching proxy, except + for requests to that ISP's sites:

+ + + + + +
+
+  forward   /                  caching-proxy.isp.example.net:8000
+  forward   .isp.example.net   .
+
+
+ +

Parent proxy specified by an IPv6 address:

+ + + + + +
+
+  forward   /                   [2001:DB8::1]:8000
+
+
+ +

Suppose your parent proxy doesn't support IPv6:

+ + + + + +
+
+  forward  /                        parent-proxy.example.org:8000
+  forward  ipv6-server.example.org  .
+  forward  <[2-3][0-9a-f][0-9a-f][0-9a-f]:*>   .
+
+
+
+
+
+
+ +
+

7.5.2. forward-socks4, + forward-socks4a and forward-socks5

+ +
+
+
Specifies:
+ +
+

Through which SOCKS proxy (and optionally to which parent + HTTP proxy) specific requests should be routed.

+
+ +
Type of value:
+ +
+

target_pattern socks_proxy[:port] http_parent[:port]

+ +

where target_pattern is a + URL pattern that + specifies to which requests (i.e. URLs) this forward rule shall + apply. Use / to denote "all URLs". http_parent and socks_proxy are IP addresses in dotted + decimal notation or valid DNS names (http_parent may be "." to denote "no HTTP + forwarding"), and the optional port parameters are TCP ports, i.e. + integer values from 1 to 65535

+
+ +
Default value:
+ +
+

Unset

+
+ +
Effect if unset:
+ +
+

Don't use SOCKS proxies.

+
+ +
Notes:
+ +
+

Multiple lines are OK, they are checked in sequence, and the + last match wins.

+ +

The difference between forward-socks4 and forward-socks4a is that in the SOCKS 4A + protocol, the DNS resolution of the target hostname happens on + the SOCKS server, while in SOCKS 4 it happens locally.

+ +

With forward-socks5 the DNS + resolution will happen on the remote server as well.

+ +

socks_proxy and http_parent can be a numerical IPv6 + address (if RFC 3493 is implemented). To prevent clashes + with the port delimiter, the whole IP address has to be put + into brackets. On the other hand a target_pattern containing an IPv6 address + has to be put into angle brackets (normal brackets are reserved + for regular expressions already).

+ +

If http_parent is + ".", then requests are not forwarded + to another HTTP proxy but are made (HTTP-wise) directly to the + web servers, albeit through a SOCKS proxy.

+
+ +
Examples:
+ +
+

From the company example.com, direct connections are made to + all "internal" domains, but + everything outbound goes through their ISP's proxy by way of + example.com's corporate SOCKS 4A gateway to the Internet.

+ + + + + +
+
+  forward-socks4a   /              socks-gw.example.com:1080  www-cache.isp.example.net:8080
+  forward           .example.com   .
+
+
+ +

A rule that uses a SOCKS 4 gateway for all destinations but + no HTTP parent looks like this:

+ + + + + +
+
+  forward-socks4   /               socks-gw.example.com:1080  .
+
+
+ +

To chain Privoxy and Tor, both running on the same system, + you would use something like:

+ + + + + +
+
+  forward-socks5   /               127.0.0.1:9050 .
+
+
+ +

The public Tor network + can't be used to reach your local network, if you need to + access local servers you therefore might want to make some + exceptions:

+ + + + + +
+
+  forward         192.168.*.*/     .
+  forward            10.*.*.*/     .
+  forward           127.*.*.*/     .
+
+
+ +

Unencrypted connections to systems in these address ranges + will be as (un)secure as the local network is, but the + alternative is that you can't reach the local network through + Privoxy at all. Of course this + may actually be desired and there is no reason to make these + exceptions if you aren't sure you need them.

+ +

If you also want to be able to reach servers in your local + network by using their names, you will need additional + exceptions that look like this:

+ + + + + +
+
+ forward           localhost/     .
+
+
+
+
+
+
+ +
+

7.5.3. Advanced Forwarding + Examples

+ +

If you have links to multiple ISPs that provide various special + content only to their subscribers, you can configure multiple + Privoxies which have connections to + the respective ISPs to act as forwarders to each other, so that + your users can see the + internal content of all ISPs.

+ +

Assume that host-a has a PPP connection to isp-a.example.net. And + host-b has a PPP connection to isp-b.example.org. Both run + Privoxy. Their forwarding + configuration can look like this:

+ +

host-a:

+ + + + + +
+
+  forward    /           .
+  forward    .isp-b.example.net  host-b:8118
+
+
+ +

host-b:

+ + + + + +
+
+  forward    /           .
+  forward    .isp-a.example.org  host-a:8118
+
+
+ +

Now, your users can set their browser's proxy to use either host-a + or host-b and be able to browse the internal content of both isp-a + and isp-b.

+ +

If you intend to chain Privoxy + and squid locally, then chaining as + browser -> squid -> privoxy is the + recommended way.

+ +

Assuming that Privoxy and + squid run on the same box, your + squid configuration could then look + like this:

+ + + + + +
+
+  # Define Privoxy as parent proxy (without ICP)
+  cache_peer 127.0.0.1 parent 8118 7 no-query
+
+  # Define ACL for protocol FTP
+  acl ftp proto FTP
+
+  # Do not forward FTP requests to Privoxy
+  always_direct allow ftp
+
+  # Forward all the rest to Privoxy
+  never_direct allow all
+
+
+ +

You would then need to change your browser's proxy settings to + squid's address and port. Squid + normally uses port 3128. If unsure consult http_port in squid.conf.

+ +

You could just as well decide to only forward requests you suspect + of leading to Windows executables through a virus-scanning parent + proxy, say, on antivir.example.com, port + 8010:

+ + + + + +
+
+  forward   /                          .
+  forward   /.*\.(exe|com|dll|zip)$    antivir.example.com:8010
+
+
+
+ +
+

7.5.4. forwarded-connect-retries

+ +
+
+
Specifies:
+ +
+

How often Privoxy retries if a forwarded connection request + fails.

+
+ +
Type of value:
+ +
+

Number of retries.

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Connections forwarded through other proxies are treated like + direct connections and no retry attempts are made.

+
+ +
Notes:
+ +
+

forwarded-connect-retries is + mainly interesting for socks4a connections, where Privoxy can't detect why the connections + failed. The connection might have failed because of a DNS + timeout in which case a retry makes sense, but it might also + have failed because the server doesn't exist or isn't + reachable. In this case the retry will just delay the + appearance of Privoxy's error message.

+ +

Note that in the context of this option, "forwarded connections" includes all connections + that Privoxy forwards through other proxies. This option is not + limited to the HTTP CONNECT method.

+ +

Only use this option, if you are getting lots of + forwarding-related error messages that go away when you try + again manually. Start with a small value and check Privoxy's + logfile from time to time, to see how many retries are usually + needed.

+
+ +
Examples:
+ +
+

forwarded-connect-retries 1

+
+
+
+
+
+ +
+

7.6. Miscellaneous

+ +
+

7.6.1. + accept-intercepted-requests

+ +
+
+
Specifies:
+ +
+

Whether intercepted requests should be treated as valid.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Only proxy requests are accepted, intercepted requests are + treated as invalid.

+
+ +
Notes:
+ +
+

If you don't trust your clients and want to force them to + use Privoxy, enable this + option and configure your packet filter to redirect outgoing + HTTP connections into Privoxy.

+ +

Make sure that Privoxy's + own requests aren't redirected as well. Additionally take care + that Privoxy can't + intentionally connect to itself, otherwise you could run into + redirection loops if Privoxy's + listening port is reachable by the outside or an attacker has + access to the pages you visit.

+
+ +
Examples:
+ +
+

accept-intercepted-requests 1

+
+
+
+
+ +
+

7.6.2. + allow-cgi-request-crunching

+ +
+
+
Specifies:
+ +
+

Whether requests to Privoxy's CGI pages can be blocked or + redirected.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Privoxy ignores block and + redirect actions for its CGI pages.

+
+ +
Notes:
+ +
+

By default Privoxy ignores + block or redirect actions for its CGI pages. Intercepting these + requests can be useful in multi-user setups to implement + fine-grained access control, but it can also render the + complete web interface useless and make debugging problems + painful if done without care.

+ +

Don't enable this option unless you're sure that you really + need it.

+
+ +
Examples:
+ +
+

allow-cgi-request-crunching 1

+
+
+
+
+ +
+

7.6.3. split-large-forms

+ +
+
+
Specifies:
+ +
+

Whether the CGI interface should stay compatible with broken + HTTP clients.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

The CGI form generate long GET URLs.

+
+ +
Notes:
+ +
+

Privoxy's CGI forms can + lead to rather long URLs. This isn't a problem as far as the + HTTP standard is concerned, but it can confuse clients with + arbitrary URL length limitations.

+ +

Enabling split-large-forms causes Privoxy to divide big forms into smaller + ones to keep the URL length down. It makes editing a lot less + convenient and you can no longer submit all changes at once, + but at least it works around this browser bug.

+ +

If you don't notice any editing problems, there is no reason + to enable this option, but if one of the submit buttons appears + to be broken, you should give it a try.

+
+ +
Examples:
+ +
+

split-large-forms 1

+
+
+
+
+ +
+

7.6.4. keep-alive-timeout

+ +
+
+
Specifies:
+ +
+

Number of seconds after which an open connection will no + longer be reused.

+
+ +
Type of value:
+ +
+

Time in seconds.

+
+ +
Default value:
+ +
+

None

+
+ +
Effect if unset:
+ +
+

Connections are not kept alive.

+
+ +
Notes:
+ +
+

This option allows clients to keep the connection to + Privoxy alive. If the server + supports it, Privoxy will keep + the connection to the server alive as well. Under certain + circumstances this may result in speed-ups.

+ +

By default, Privoxy will + close the connection to the server if the client connection + gets closed, or if the specified timeout has been reached + without a new request coming in. This behaviour can be changed + with the connection-sharing option.

+ +

This option has no effect if Privoxy has been compiled without + keep-alive support.

+ +

Note that a timeout of five seconds as used in the default + configuration file significantly decreases the number of + connections that will be reused. The value is used because some + browsers limit the number of connections they open to a single + host and apply the same limit to proxies. This can result in a + single website "grabbing" all the + connections the browser allows, which means connections to + other websites can't be opened until the connections currently + in use time out.

+ +

Several users have reported this as a Privoxy bug, so the + default value has been reduced. Consider increasing it to 300 + seconds or even more if you think your browser can handle it. + If your browser appears to be hanging it can't.

+
+ +
Examples:
+ +
+

keep-alive-timeout 300

+
+
+
+
+ +
+

7.6.5. default-server-timeout

+ +
+
+
Specifies:
+ +
+

Assumed server-side keep-alive timeout if not specified by + the server.

+
+ +
Type of value:
+ +
+

Time in seconds.

+
+ +
Default value:
+ +
+

None

+
+ +
Effect if unset:
+ +
+

Connections for which the server didn't specify the + keep-alive timeout are not reused.

+
+ +
Notes:
+ +
+

Enabling this option significantly increases the number of + connections that are reused, provided the keep-alive-timeout + option is also enabled.

+ +

While it also increases the number of connections problems + when Privoxy tries to reuse a + connection that already has been closed on the server side, or + is closed while Privoxy is + trying to reuse it, this should only be a problem if it happens + for the first request sent by the client. If it happens for + requests on reused client connections, Privoxy will simply close the connection + and the client is supposed to retry the request without + bothering the user.

+ +

Enabling this option is therefore only recommended if the + connection-sharing option is disabled.

+ +

It is an error to specify a value larger than the keep-alive-timeout + value.

+ +

This option has no effect if Privoxy has been compiled without + keep-alive support.

+
+ +
Examples:
+ +
+

default-server-timeout 60

+
+
+
+
+ +
+

7.6.6. connection-sharing

+ +
+
+
Specifies:
+ +
+

Whether or not outgoing connections that have been kept + alive should be shared between different incoming + connections.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

None

+
+ +
Effect if unset:
+ +
+

Connections are not shared.

+
+ +
Notes:
+ +
+

This option has no effect if Privoxy has been compiled without + keep-alive support, or if it's disabled.

+
+ +
Notes:
+ +
+

Note that reusing connections doesn't necessary cause + speedups. There are also a few privacy implications you should + be aware of.

+ +

If this option is effective, outgoing connections are shared + between clients (if there are more than one) and closing the + browser that initiated the outgoing connection does no longer + affect the connection between Privoxy and the server unless the client's + request hasn't been completed yet.

+ +

If the outgoing connection is idle, it will not be closed + until either Privoxy's or the + server's timeout is reached. While it's open, the server knows + that the system running Privoxy is still there.

+ +

If there are more than one client (maybe even belonging to + multiple users), they will be able to reuse each others + connections. This is potentially dangerous in case of + authentication schemes like NTLM where only the connection is + authenticated, instead of requiring authentication for each + request.

+ +

If there is only a single client, and if said client can + keep connections alive on its own, enabling this option has + next to no effect. If the client doesn't support connection + keep-alive, enabling this option may make sense as it allows + Privoxy to keep outgoing + connections alive even if the client itself doesn't support + it.

+ +

You should also be aware that enabling this option increases + the likelihood of getting the "No server or forwarder data" + error message, especially if you are using a slow connection to + the Internet.

+ +

This option should only be used by experienced users who + understand the risks and can weight them against the + benefits.

+
+ +
Examples:
+ +
+

connection-sharing 1

+
+
+
+
+ +
+

7.6.7. + socket-timeout

+ +
+
+
Specifies:
+ +
+

Number of seconds after which a socket times out if no data + is received.

+
+ +
Type of value:
+ +
+

Time in seconds.

+
+ +
Default value:
+ +
+

None

+
+ +
Effect if unset:
+ +
+

A default value of 300 seconds is used.

+
+ +
Notes:
+ +
+

The default is quite high and you probably want to reduce + it. If you aren't using an occasionally slow proxy like Tor, + reducing it to a few seconds should be fine.

+
+ +
Examples:
+ +
+

socket-timeout 300

+
+
+
+
+ +
+

7.6.8. max-client-connections

+ +
+
+
Specifies:
+ +
+

Maximum number of client connections that will be + served.

+
+ +
Type of value:
+ +
+

Positive number.

+
+ +
Default value:
+ +
+

None

+
+ +
Effect if unset:
+ +
+

Connections are served until a resource limit is + reached.

+
+ +
Notes:
+ +
+

Privoxy creates one thread + (or process) for every incoming client connection that isn't + rejected based on the access control settings.

+ +

If the system is powerful enough, Privoxy can theoretically deal with + several hundred (or thousand) connections at the same time, but + some operating systems enforce resource limits by shutting down + offending processes and their default limits may be below the + ones Privoxy would require + under heavy load.

+ +

Configuring Privoxy to + enforce a connection limit below the thread or process limit + used by the operating system makes sure this doesn't happen. + Simply increasing the operating system's limit would work too, + but if Privoxy isn't the only + application running on the system, you may actually want to + limit the resources used by Privoxy.

+ +

If Privoxy is only used by + a single trusted user, limiting the number of client + connections is probably unnecessary. If there are multiple + possibly untrusted users you probably still want to + additionally use a packet filter to limit the maximal number of + incoming connections per client. Otherwise a malicious user + could intentionally create a high number of connections to + prevent other users from using Privoxy.

+ +

Obviously using this option only makes sense if you choose a + limit below the one enforced by the operating system.

+
+ +
Examples:
+ +
+

max-client-connections 256

+
+
+
+
+ +
+

7.6.9. + handle-as-empty-doc-returns-ok

+ +
+
+
Specifies:
+ +
+

The status code Privoxy returns for pages blocked with + +handle-as-empty-document.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Privoxy returns a status 403(forbidden) for all blocked + pages.

+
+ +
Effect if set:
+ +
+

Privoxy returns a status 200(OK) for pages blocked with + +handle-as-empty-document and a status 403(Forbidden) for all + other blocked pages.

+
+ +
Notes:
+ +
+

This is a work-around for Firefox bug 492459: " Websites are no longer rendered if SSL requests for + JavaScripts are blocked by a proxy. " (https://bugzilla.mozilla.org/show_bug.cgi?id=492459) + As the bug has been fixed for quite some time this option + should no longer be needed and will be removed in a future + release. Please speak up if you have a reason why the option + should be kept around.

+
+
+
+
+ +
+

7.6.10. enable-compression

+ +
+
+
Specifies:
+ +
+

Whether or not buffered content is compressed before + delivery.

+
+ +
Type of value:
+ +
+

0 or 1

+
+ +
Default value:
+ +
+

0

+
+ +
Effect if unset:
+ +
+

Privoxy does not compress buffered content.

+
+ +
Effect if set:
+ +
+

Privoxy compresses buffered content before delivering it to + the client, provided the client supports it.

+
+ +
Notes:
+ +
+

This directive is only supported if Privoxy has been + compiled with FEATURE_COMPRESSION, which should not to be + confused with FEATURE_ZLIB.

+ +

Compressing buffered content is mainly useful if Privoxy and + the client are running on different systems. If they are + running on the same system, enabling compression is likely to + slow things down. If you didn't measure otherwise, you should + assume that it does and keep this option disabled.

+ +

Privoxy will not compress buffered content below a certain + length.

+
+
+
+
+ +
+

7.6.11. compression-level

+ +
+
+
Specifies:
+ +
+

The compression level that is passed to the zlib library + when compressing buffered content.

+
+ +
Type of value:
+ +
+

Positive number ranging from 0 to + 9.

+
+ +
Default value:
+ +
+

1

+
+ +
Notes:
+ +
+

Compressing the data more takes usually longer than + compressing it less or not compressing it at all. Which level + is best depends on the connection between Privoxy and the + client. If you can't be bothered to benchmark it for yourself, + you should stick with the default and keep compression + disabled.

+ +

If compression is disabled, the compression level is + irrelevant.

+
+ +
Examples:
+ +
+ + + + +
+
+    # Best speed (compared to the other levels)
+    compression-level 1
+    # Best compression
+    compression-level 9
+    # No compression. Only useful for testing as the added header
+    # slightly increases the amount of data that has to be sent.
+    # If your benchmark shows that using this compression level
+    # is superior to using no compression at all, the benchmark
+    # is likely to be flawed.
+    compression-level 0
+
+
+
+
+
+
+
+
+ +
+

7.7. Windows + GUI Options

+ +

Privoxy has a number of options + specific to the Windows GUI interface:

+ +

If "activity-animation" is set to 1, the + Privoxy icon will animate when + "Privoxy" is active. To turn off, set to + 0.

+ +

  activity-animation 1
+    

+ +

If "log-messages" is set to 1, + Privoxy will log messages to the + console window:

+ +

  log-messages 1
+    

+ +

If "log-buffer-size" is set to 1, the + size of the log buffer, i.e. the amount of memory used for the log + messages displayed in the console window, will be limited to + "log-max-lines" (see below).

+ +

Warning: Setting this to 0 will result in the buffer to grow + infinitely and eat up all your memory!

+ +

  log-buffer-size 1
+    

+ +

log-max-lines is the maximum number + of lines held in the log buffer. See above.

+ +

  log-max-lines 200
+    

+ +

If "log-highlight-messages" is set to 1, + Privoxy will highlight portions of the + log messages with a bold-faced font:

+ +

  log-highlight-messages 1
+    

+ +

The font used in the console window:

+ +

  log-font-name Comic Sans MS
+    

+ +

Font size used in the console window:

+ +

  log-font-size 8
+    

+ +

"show-on-task-bar" controls whether or + not Privoxy will appear as a button on + the Task bar when minimized:

+ +

  show-on-task-bar 0
+    

+ +

If "close-button-minimizes" is set to 1, + the Windows close button will minimize Privoxy instead of closing the program (close with + the exit option on the File menu).

+ +

  close-button-minimizes 1
+    

+ +

The "hide-console" option is specific to + the MS-Win console version of Privoxy. + If this option is used, Privoxy will + disconnect from and hide the command console.

+ +

  #hide-console
+    

+
+ + + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/configuration.html privoxy-3.0.19/doc/webserver/user-manual/configuration.html --- privoxy-3.0.17/doc/webserver/user-manual/configuration.html 2010-11-13 12:51:20.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/configuration.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,514 +1,282 @@ - -Privoxy Configuration - -
Privoxy 3.0.17 User Manual
PrevNext

6. Privoxy Configuration

All Privoxy configuration is stored - in text files. These files can be edited with a text editor. - Many important aspects of Privoxy can - also be controlled easily with a web browser. -

6.1. Controlling Privoxy with Your Web Browser

Privoxy's user interface can be reached through the special - URL http://config.privoxy.org/ - (shortcut: http://p.p/), - which is a built-in page and works without Internet access. - You will see the following section:

 

    Privoxy Menu

        ▪  View & change the current configuration -
        ▪  View the source code version numbers -
        ▪  View the request headers. -
        ▪  Look up which actions apply to a URL and why -
        ▪  Toggle Privoxy on or off -
        ▪  Documentation -

This should be self-explanatory. Note the first item leads to an editor for the - actions files, which is where the ad, banner, - cookie, and URL blocking magic is configured as well as other advanced features of - Privoxy. This is an easy way to adjust various - aspects of Privoxy configuration. The actions - file, and other configuration files, are explained in detail below.

"Toggle Privoxy On or Off" is handy for sites that might - have problems with your current actions and filters. You can in fact use - it as a test to see whether it is Privoxy - causing the problem or not. Privoxy continues - to run as a proxy in this case, but all manipulation is disabled, i.e. - Privoxy acts like a normal forwarding proxy. There - is even a toggle Bookmarklet offered, so - that you can toggle Privoxy with one click from - your browser.

Note that several of the features described above are disabled by default - in Privoxy 3.0.7 beta and later. - Check the - configuration file to learn why - and in which cases it's safe to enable them again.

6.2. Configuration Files Overview

For Unix, *BSD and Linux, all configuration files are located in - /etc/privoxy/ by default. For MS Windows, OS/2, and - AmigaOS these are all in the same directory as the - Privoxy executable.

The installed defaults provide a reasonable starting point, though - some settings may be aggressive by some standards. For the time being, the - principle configuration files are:

  • The main configuration file is named config - on Linux, Unix, BSD, OS/2, and AmigaOS and config.txt - on Windows. This is a required file. -

  • match-all.action is used to define which "actions" - relating to banner-blocking, images, pop-ups, content modification, cookie handling - etc should be applied by default. It should be the first actions file loaded. -

    default.action defines many exceptions (both positive and negative) - from the default set of actions that's configured in match-all.action. - It should be the second actions file loaded and shouldn't be edited by the user. -

    Multiple actions files may be defined in config. These - are processed in the order they are defined. Local customizations and locally - preferred exceptions to the default policies as defined in - match-all.action (which you will most probably want - to define sooner or later) are best applied in user.action, - where you can preserve them across upgrades. The file isn't installed by all - installers, but you can easily create it yourself with a text editor. -

    - There is also a web based editor that can be accessed from - http://config.privoxy.org/show-status - (Shortcut: http://p.p/show-status) for the - various actions files. -

  • "Filter files" (the filter - file) can be used to re-write the raw page content, including - viewable text as well as embedded HTML and JavaScript, and whatever else - lurks on any given web page. The filtering jobs are only pre-defined here; - whether to apply them or not is up to the actions files. - default.filter includes various filters made - available for use by the developers. Some are much more intrusive than - others, and all should be used with caution. You may define additional - filter files in config as you can with - actions files. We suggest user.filter for any - locally defined filters or customizations. -

The syntax of the configuration and filter files may change between different - Privoxy versions, unfortunately some enhancements cost backwards compatibility. -

All files use the "#" character to denote a - comment (the rest of the line will be ignored) and understand line continuation - through placing a backslash ("\") as the very last character - in a line. If the # is preceded by a backslash, it looses - its special function. Placing a # in front of an otherwise - valid configuration line to prevent it from being interpreted is called "commenting - out" that line. Blank lines are ignored.

The actions files and filter files - can use Perl style regular expressions for - maximum flexibility.

After making any changes, there is no need to restart - Privoxy in order for the changes to take - effect. Privoxy detects such changes - automatically. Note, however, that it may take one or two additional - requests for the change to take effect. When changing the listening address - of Privoxy, these "wake up" requests - must obviously be sent to the old listening address.


PrevHomeNext
Starting Privoxy The Main Configuration File
\ No newline at end of file + + + + + + + Privoxy Configuration + + + + + + + + + + + + + +
+

6. Privoxy + Configuration

+ +

All Privoxy configuration is stored + in text files. These files can be edited with a text editor. Many + important aspects of Privoxy can also be + controlled easily with a web browser.

+ +
+

6.1. Controlling + Privoxy with Your Web Browser

+ +

Privoxy's user interface can be + reached through the special URL http://config.privoxy.org/ (shortcut: http://p.p/), which is a built-in page + and works without Internet access. You will see the following + section:

+ + + + + +
+
+
+
+ +

    Privoxy Menu

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+         ▪  View & change the current + configuration
+         ▪  View the source code version numbers
+         ▪  View the request headers.
+         ▪  Look up which actions apply to a URL and + why
+         ▪  Toggle Privoxy on or off
+         ▪  Documentation
+
+ +

This should be self-explanatory. Note the first item leads to an + editor for the actions files, which is + where the ad, banner, cookie, and URL blocking magic is configured as + well as other advanced features of Privoxy. This is an easy way to adjust various + aspects of Privoxy configuration. The + actions file, and other configuration files, are explained in detail + below.

+ +

"Toggle Privoxy On or Off" is handy for + sites that might have problems with your current actions and filters. + You can in fact use it as a test to see whether it is Privoxy causing the problem or not. Privoxy continues to run as a proxy in this case, + but all manipulation is disabled, i.e. Privoxy acts like a normal forwarding proxy. There + is even a toggle Bookmarklet + offered, so that you can toggle Privoxy with one click from your browser.

+ +

Note that several of the features described above are disabled by + default in Privoxy 3.0.7 beta and + later. Check the configuration + file to learn why and in which cases it's safe to enable them + again.

+
+ +
+

6.2. + Configuration Files Overview

+ +

For Unix, *BSD and Linux, all configuration files are located in + /etc/privoxy/ by default. For MS Windows, + OS/2, and AmigaOS these are all in the same directory as the + Privoxy executable.

+ +

The installed defaults provide a reasonable starting point, though + some settings may be aggressive by some standards. For the time being, + the principle configuration files are:

+ +
    +
  • +

    The main configuration file is named + config on Linux, Unix, BSD, OS/2, and + AmigaOS and config.txt on Windows. This + is a required file.

    +
  • + +
  • +

    match-all.action is used to define + which "actions" relating to + banner-blocking, images, pop-ups, content modification, cookie + handling etc should be applied by default. It should be the first + actions file loaded.

    + +

    default.action defines many exceptions + (both positive and negative) from the default set of actions that's + configured in match-all.action. It should + be the second actions file loaded and shouldn't be edited by the + user.

    + +

    Multiple actions files may be defined in config. These are processed in the order they are + defined. Local customizations and locally preferred exceptions to + the default policies as defined in match-all.action (which you will most probably want + to define sooner or later) are best applied in user.action, where you can preserve them across + upgrades. The file isn't installed by all installers, but you can + easily create it yourself with a text editor.

    + +

    There is also a web based editor that can be accessed from + http://config.privoxy.org/show-status (Shortcut: + http://p.p/show-status) for the various actions + files.

    +
  • + +
  • +

    "Filter files" (the filter file) can be used to re-write the raw + page content, including viewable text as well as embedded HTML and + JavaScript, and whatever else lurks on any given web page. The + filtering jobs are only pre-defined here; whether to apply them or + not is up to the actions files. default.filter includes various filters made + available for use by the developers. Some are much more intrusive + than others, and all should be used with caution. You may define + additional filter files in config as you + can with actions files. We suggest user.filter for any locally defined filters or + customizations.

    +
  • +
+ +

The syntax of the configuration and filter files may change between + different Privoxy versions, unfortunately some enhancements cost + backwards compatibility.

+ +

All files use the "#" character to denote a comment (the rest of the + line will be ignored) and understand line continuation through placing + a backslash ("\") as the very last character + in a line. If the # is preceded by a + backslash, it looses its special function. Placing a # in front of an otherwise valid configuration line to + prevent it from being interpreted is called "commenting out" that line. + Blank lines are ignored.

+ +

The actions files and filter files can use Perl style regular expressions for maximum + flexibility.

+ +

After making any changes, there is no need to restart Privoxy in order for the changes to take effect. + Privoxy detects such changes + automatically. Note, however, that it may take one or two additional + requests for the change to take effect. When changing the listening + address of Privoxy, these "wake up" requests must obviously be sent to the + old listening address.

+
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/contact.html privoxy-3.0.19/doc/webserver/user-manual/contact.html --- privoxy-3.0.17/doc/webserver/user-manual/contact.html 2010-11-13 13:12:07.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/contact.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,560 +1,364 @@ - -Contacting the Developers, Bug Reporting and Feature -Requests - -
Privoxy 3.0.17 User Manual
PrevNext

11. Contacting the Developers, Bug Reporting and Feature -Requests

We value your feedback. In fact, we rely on it to improve - Privoxy and its configuration. - However, please note the following hints, so we can - provide you with the best support:

11.1. Get Support

For casual users, our - support forum at SourceForge - is probably best suited: - http://sourceforge.net/tracker/?group_id=11118&atid=211118

All users are of course welcome to discuss their issues on the users - mailing list, where the developers also hang around.

Please don't sent private support requests to individual Privoxy - developers, either use the mailing lists or the support trackers.

Note that the Privoxy mailing lists are moderated. Posts from unsubscribed - addresses have to be accepted manually by a moderator. This may cause a - delay of several days and if you use a subject that doesn't clearly - mention Privoxy or one of its features, your message may be accidentally - discarded as spam.

If you aren't subscribed, you should therefore spend a few seconds - to come up with a proper subject. Additionally you should make it clear - that you want to get CC'd. Otherwise some responses will be directed to - the mailing list only, and you won't see them.

11.2. Reporting Problems

"Problems" for our purposes, come in two forms:

  • Configuration issues, such as ads that slip through, or sites that - don't function properly due to one Privoxy - "action" or another being turned "on". -

  • "Bugs" in the programming code that makes up - Privoxy, such as that might cause a crash. -

11.2.1. Reporting Ads or Other Configuration Problems

Please send feedback on ads that slipped through, innocent images that were - blocked, sites that don't work properly, and other configuration related problem of - default.action file, to - http://sourceforge.net/tracker/?group_id=11118&atid=460288, - the Actions File Tracker.

New, improved default.action files may occasionally be made - available based on your feedback. These will be announced on the ijbswa-announce - list and available from our the files section of - our project page.

11.2.2. Reporting Bugs

Please report all bugs through our bug tracker: - http://sourceforge.net/tracker/?group_id=11118&atid=111118.

Before doing so, please make sure that the bug has not already been submitted - and observe the additional hints at the top of the submit - form. If already submitted, please feel free to add any info to the - original report that might help to solve the issue.

Please try to verify that it is a Privoxy bug, - and not a browser or site bug or documented behaviour that just happens - to be different than what you expected. If unsure, - try toggling - off Privoxy, and see if the problem persists.

If you are using your own custom configuration, please try - the stock configs to see if the problem is configuration related. - If you're having problems with a feature that is disabled by default, - please ask around on the mailing list if others can reproduce the problem.

If you aren't using the latest Privoxy version, the bug may have been found - and fixed in the meantime. We would appreciate if you could take the time - to upgrade - to the latest version (or even the latest CVS snapshot) and verify - that your bug still exists.

Please be sure to provide the following information:

  • The exact Privoxy version you are using - (if you got the source from CVS, please also provide the source code revisions - as shown in http://config.privoxy.org/show-version). -

  • The operating system and versions you run - Privoxy on, (e.g. Windows - XP SP2), if you are using a Unix flavor, - sending the output of "uname -a" should do, - in case of GNU/Linux, please also name the distribution. -

  • The name, platform, and version of the browser - you were using (e.g. Internet Explorer v5.5 for Mac). -

  • The URL where the problem occurred, or some way for us to duplicate the - problem (e.g. http://somesite.example.com/?somethingelse=123). -

  • Whether your version of Privoxy is one supplied - by the Privoxy developers via SourceForge, - or if you got your copy somewhere else. -

  • Whether you are using Privoxy in tandem with - another proxy such as Tor. If so, please - temporary disable the other proxy to see if the symptoms change. -

  • Whether you are using a personal firewall product. If so, does - Privoxy work without it? -

  • Any other pertinent information to help identify the problem such as config - or log file excerpts (yes, you should have log file entries for each - action taken). To get a meaningful logfile, please make sure that the - logfile directive - is being used and the following debug options are enabled: -

    debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.
    -debug     2 # show each connection status
    -debug     4 # show I/O status
    -debug     8 # show header parsing
    -debug   128 # debug redirects
    -debug   256 # debug GIF de-animation
    -debug   512 # Common Log Format
    -debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
    -debug  4096 # Startup banner and warnings.
    -debug  8192 # Non-fatal errors

    - If you are having trouble with a filter, please additionally enable -

    debug    64 # debug regular expression filters

    - If you are using Privoxy 3.0.17 or later and suspect that it interprets the - request or the response incorrectly, please enable -

    debug 32768 # log all data read from the network

    - Note that Privoxy log files may contain sensitive information so please don't - submit any logfiles you didn't read first. You can mask sensitive information - as long as it's clear that you removed something. -

You don't have to tell us your actual name when filing a problem - report, but if you don't, please use a nickname so we can differentiate - between your messages and the ones entered by other "anonymous" users that - may respond to your request if they have the same problem or already - found a solution. Note that due to spam the trackers may not always - allow to post without being logged into SourceForge. If that's the - case, you are still free to create a login that isn't directly linked - to your name, though.

Please also check the status of your request a few days after submitting - it, as we may request additional information. If you use a SF id, - you should automatically get a mail when someone responds to your request. - Please don't bother to add an email address when using the tracker. - If you prefer to communicate through email, just use one of the mailing - lists directly.

The appendix - of the Privoxy User Manual also has helpful information - on understanding actions, and action debugging.

11.3. Request New Features

You are welcome to submit ideas on new features or other proposals - for improvement through our feature request tracker at - http://sourceforge.net/tracker/?atid=361118&group_id=11118.

11.4. Mailing Lists

If you prefer to communicate through email, instead of using a web interface, -feel free to use one of the mailing lists. -To discuss issues that haven't been completely diagnosed yet, please use the Privoxy -users list. Technically interested users and people who wish to contribute to -the project are always welcome on the developers list. -You can find an overview of all Privoxy-related mailing lists, -including list archives, at: -http://sourceforge.net/mail/?group_id=11118.


PrevHomeNext
Privoxy's Template Files Privoxy Copyright, License and History
+ + + + + + + Contacting the Developers, Bug Reporting and Feature + Requests + + + + + + + + + + + + + +
+

11. Contacting the + Developers, Bug Reporting and Feature Requests

+ +

We value your feedback. In fact, we rely on it to improve Privoxy and its configuration. However, please note + the following hints, so we can provide you with the best support:

+ +
+

11.1. + Get Support

+ +

For casual users, our support forum at SourceForge is probably best suited: + http://sourceforge.net/tracker/?group_id=11118&atid=211118

+ +

All users are of course welcome to discuss their issues on the + users mailing list, where the developers also hang + around.

+ +

Please don't sent private support requests to individual Privoxy + developers, either use the mailing lists or the support trackers.

+ +

If you have to contact a Privoxy developer directly for other + reasons, please send a real mail and do not bother with SourceForge's + messaging system. Answers to SourceForge messages are usually bounced + by SourceForge's mail server in which case the developer wasted time + writing a response you don't get. From your point of view it will look + like your message has been completely ignored, so this is frustrating + for all parties involved.

+ +

Note that the Privoxy mailing lists are moderated. Posts from + unsubscribed addresses have to be accepted manually by a moderator. + This may cause a delay of several days and if you use a subject that + doesn't clearly mention Privoxy or one of its features, your message + may be accidentally discarded as spam.

+ +

If you aren't subscribed, you should therefore spend a few seconds + to come up with a proper subject. Additionally you should make it clear + that you want to get CC'd. Otherwise some responses will be directed to + the mailing list only, and you won't see them.

+
+ +
+

11.2. Reporting + Problems

+ +

"Problems" for our purposes, come in two + forms:

+ +
    +
  • +

    Configuration issues, such as ads that slip through, or sites + that don't function properly due to one Privoxy "action" or + another being turned "on".

    +
  • + +
  • +

    "Bugs" in the programming code that + makes up Privoxy, such as that + might cause a crash.

    +
  • +
+ +
+

11.2.1. + Reporting Ads or Other Configuration Problems

+ +

Please send feedback on ads that slipped through, innocent images + that were blocked, sites that don't work properly, and other + configuration related problem of default.action file, to http://sourceforge.net/tracker/?group_id=11118&atid=460288, + the Actions File Tracker.

+ +

New, improved default.action files may + occasionally be made available based on your feedback. These will be + announced on the ijbswa-announce list and available from our the files section of our project page.

+
+ +
+

11.2.2. + Reporting Bugs

+ +

Please report all bugs through our bug tracker: http://sourceforge.net/tracker/?group_id=11118&atid=111118.

+ +

Before doing so, please make sure that the bug has not already been submitted and observe + the additional hints at the top of the submit form. If already submitted, please feel free + to add any info to the original report that might help to solve the + issue.

+ +

Please try to verify that it is a Privoxy bug, and not a browser or site bug or + documented behaviour that just happens to be different than what you + expected. If unsure, try toggling + off Privoxy, and see if the + problem persists.

+ +

If you are using your own custom configuration, please try the + stock configs to see if the problem is configuration related. If + you're having problems with a feature that is disabled by default, + please ask around on the mailing list if others can reproduce the + problem.

+ +

If you aren't using the latest Privoxy version, the bug may have + been found and fixed in the meantime. We would appreciate if you + could take the time to upgrade to the latest version (or even the latest CVS + snapshot) and verify that your bug still exists.

+ +

Please be sure to provide the following information:

+ +
    +
  • +

    The exact Privoxy version you + are using (if you got the source from CVS, please also provide + the source code revisions as shown in http://config.privoxy.org/show-version).

    +
  • + +
  • +

    The operating system and versions you run Privoxy on, (e.g. Windows XP SP2), if you are using a Unix + flavor, sending the output of "uname + -a" should do, in case of GNU/Linux, please also name the + distribution.

    +
  • + +
  • +

    The name, platform, and version of the browser you were using (e.g. Internet Explorer v5.5 for Mac).

    +
  • + +
  • +

    The URL where the problem occurred, or some way for us to + duplicate the problem (e.g. http://somesite.example.com/?somethingelse=123).

    +
  • + +
  • +

    Whether your version of Privoxy is one supplied by the Privoxy developers via SourceForge, or if + you got your copy somewhere else.

    +
  • + +
  • +

    Whether you are using Privoxy + in tandem with another proxy such as Tor. If so, please temporary disable the + other proxy to see if the symptoms change.

    +
  • + +
  • +

    Whether you are using a personal firewall product. If so, does + Privoxy work without it?

    +
  • + +
  • +

    Any other pertinent information to help identify the problem + such as config or log file excerpts (yes, you should have log + file entries for each action taken). To get a meaningful logfile, + please make sure that the logfile + directive is being used and the following debug + options are enabled:

    + +

    + debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.
    + + debug     2 # show each connection status
    + + debug     4 # show I/O status
    + + debug     8 # show header parsing
    + + debug   128 # debug redirects
    + debug   256 # debug GIF de-animation
    + + debug   512 # Common Log Format
    + + debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
    + + debug  4096 # Startup banner and warnings.
    + + debug  8192 # Non-fatal errors

    If you + are having trouble with a filter, please additionally enable + +

    + debug    64 # debug regular expression filters

    If + you are using Privoxy 3.0.17 or later and suspect that it + interprets the request or the response incorrectly, please enable + +

    + debug 32768 # log all data read from the network

    Note + that Privoxy log files may contain sensitive information so + please don't submit any logfiles you didn't read first. You can + mask sensitive information as long as it's clear that you removed + something. +
  • +
+ +

You don't have to tell us your actual name when filing a problem + report, but if you don't, please use a nickname so we can + differentiate between your messages and the ones entered by other + "anonymous" users that may respond to your request if they have the + same problem or already found a solution. Note that due to spam the + trackers may not always allow to post without being logged into + SourceForge. If that's the case, you are still free to create a login + that isn't directly linked to your name, though.

+ +

Please also check the status of your request a few days after + submitting it, as we may request additional information. If you use a + SF id, you should automatically get a mail when someone responds to + your request. Please don't bother to add an email address when using + the tracker. If you prefer to communicate through email, just use one + of the mailing lists directly.

+ +

If you are new to reporting problems, you might be interested in + How to Report Bugs Effectively.

+ +

The appendix of the Privoxy User Manual also has + helpful information on understanding actions, and action + debugging.

+
+
+ +
+

11.3. + Request New Features

+ +

You are welcome to submit ideas on new features or other proposals + for improvement through our feature request tracker at http://sourceforge.net/tracker/?atid=361118&group_id=11118.

+
+ +
+

11.4. + Mailing Lists

+ +

If you prefer to communicate through email, instead of using a web + interface, feel free to use one of the mailing lists. To discuss issues + that haven't been completely diagnosed yet, please use the Privoxy + users list. Technically interested users and people who wish to + contribute to the project are always welcome on the developers list. + You can find an overview of all Privoxy-related mailing lists, including list + archives, at: http://sourceforge.net/mail/?group_id=11118.

+
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/copyright.html privoxy-3.0.19/doc/webserver/user-manual/copyright.html --- privoxy-3.0.17/doc/webserver/user-manual/copyright.html 2010-11-13 12:51:20.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/copyright.html 2011-12-26 18:42:00.000000000 +0000 @@ -1,430 +1,285 @@ - -Privoxy Copyright, License and History - -
Privoxy 3.0.17 User Manual
PrevNext

12. Privoxy Copyright, License and History

Copyright Š 2001-2010 by Privoxy Developers <ijbswa-developers@lists.sourceforge.net>

Some source code is based on code Copyright Š 1997 by Anonymous Coders - and Junkbusters, Inc. and licensed under the GNU General Public - License.

12.1. License

Privoxy is free software; you can - redistribute it and/or modify it under the terms of the - GNU General Public License, version 2, - as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

You should have received a copy of the GNU GPL - along with this program; if not, write to the

 Free Software
- Foundation, Inc. 51 Franklin Street, Fifth Floor
BostonMA 02110-1301
USA 

12.2. History

A long time ago, there was the - Internet Junkbuster, - by Anonymous Coders and Junkbusters - Corporation. This saved many users a lot of pain in the early days of - web advertising and user tracking.

But the web, its protocols and standards, and with it, the techniques for - forcing ads on users, give up autonomy over their browsing, and - for tracking them, keeps evolving. Unfortunately, the Internet - Junkbuster did not. Version 2.0.2, published in 1998, was - (and is) the last official - release - available from Junkbusters Corporation. - Fortunately, it had been released under the GNU - GPL, - which allowed further development by others.

So Stefan Waldherr started maintaining an improved version of the - software, to which eventually a number of people contributed patches. - It could already replace banners with a transparent image, and had a first - version of pop-up killing, but it was still very closely based on the - original, with all its limitations, such as the lack of HTTP/1.1 support, - flexible per-site configuration, or content modification. The last release - from this effort was version 2.0.2-10, published in 2000.

Then, some - developers - picked up the thread, and started turning the software inside out, upside down, - and then reassembled it, adding many - new - features along the way.

The result of this is Privoxy, whose first - stable version, 3.0, was released August, 2002. -

12.3. Authors

Current Privoxy Team:

 Fabian Keil, lead developer
- David Schmidt, developer
-
- Hal Burgiss
- Mark Miller
- Gerry Murphy
- Lee Rian
- Roland Rosenfeld

Former Privoxy Team Members:

 Johny Agotnes
- Rodrigo Barbosa
- Moritz Barsnick
- Ian Cummings
- Brian Dessent
- Jon Foster
- Karsten Hopp
- Alexander Lazic
- Daniel Leite
- Gábor Lipták
- Adam Lock
- Guy Laroche
- Justin McMurtry
- Andreas Oesterhelt
- Haroon Rafique
- Georg Sauthoff
- Thomas Steudten
- Jörg Strohmayer
- Rodney Stromlund
- Sviatoslav Sviridov
- Sarantis Paskalis
- Stefan Waldherr

Thanks to the many people who have tested Privoxy, reported bugs, provided - patches, made suggestions or contributed in some way. These include (in - alphabetical order):

 Ken Arromdee
- Devin Bayer
- Havard Berland
- Gergely Bor
- Francois Botha
- Reiner Buehl
- Andrew J. Caines
- Clifford Caoile
- Wan-Teh Chang
- Frédéric Crozat
- Michael T. Davis
- Mattes Dolak
- Matthias Drochner
- Peter E.
- Florian Effenberger
- Markus Elfring
- Dean Gaudet
- Stephen Gildea
- Daniel Griscom
- Felix Gröbert
- Jeff H.
- Aaron Hamid
- Darel Henman
- Magnus Holmgren
- Eric M. Hopper
- Ralf Horstmann
- Stefan Huehner
- Peter Hyman
- Derek Jennings
- Petr Kadlec
- David Laight
- Bert van Leeuwen
- Don Libes
- Paul Lieverse
- Toby Lyward
- Wil Mahan
- Jindrich Makovicka
- Francois Marier
- David Mediavilla
- Raphael Moll
- Amuro Namie
- Adam Piggott
- Petr Písar
- Dan Price
- Roberto Ragusa
- Félix Rauch
- Maynard Riley
- Chung-chieh Shan
- Spinor S.
- Bart Schelstraete
- Oliver Stoeneberg
- Peter Thoenen
- Martin Thomas
- Bobby G. Vinyard
- Jochen Voss
- Glenn Washburn
- Song Weijia
- Jörg Weinmann
- Darren Wiebe
- Anduin Withers
- Oliver Yeoh
- Jamie Zawinski

Privoxy is based in part on code originally developed by - Junkbusters Corp. and Anonymous Coders.

Privoxy heavily relies on Philip Hazel's PCRE.

The code to filter compressed content makes use of zlib - which is written by Jean-loup Gailly and Mark Adler.

On systems that lack snprintf(), Privoxy is using a version - written by Mark Martinec. On systems that lack strptime(), - Privoxy is using the one from the GNU C Library written - by Ulrich Drepper.


PrevHomeNext
Contacting the Developers, Bug Reporting and Feature -Requests See Also
+ + + + + + + Privoxy Copyright, License and History + + + + + + + + + + + + + +
+

12. Privoxy + Copyright, License and History

+ +

Copyright © 2001-2011 by Privoxy Developers <ijbswa-developers@lists.sourceforge.net>

+ +

Some source code is based on code Copyright © 1997 by Anonymous + Coders and Junkbusters, Inc. and licensed under the GNU General Public License.

+ +
+

12.1. License

+ +

Privoxy is free software; you can + redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by + the Free Software Foundation.

+ +

This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.

+ +

You should have received a copy of the GNU + GPL along with this program; if not, write to the

+ +

 Free Software
+  Foundation, Inc. 51 Franklin + Street, Fifth Floor
+  BostonMA 02110-1301
+  USA 

+
+ +
+

12.2. History

+ +

A long time ago, there was the Internet Junkbuster, by Anonymous Coders and + Junkbusters + Corporation. This saved many users a lot of pain in the early days + of web advertising and user tracking.

+ +

But the web, its protocols and standards, and with it, the + techniques for forcing ads on users, give up autonomy over their + browsing, and for tracking them, keeps evolving. Unfortunately, the + Internet Junkbuster did not. Version + 2.0.2, published in 1998, was (and is) the last official release available from Junkbusters Corporation. Fortunately, it had been + released under the GNU GPL, which allowed further development by others.

+ +

So Stefan Waldherr started maintaining an improved version of the + software, to which eventually a number of people contributed patches. + It could already replace banners with a transparent image, and had a + first version of pop-up killing, but it was still very closely based on + the original, with all its limitations, such as the lack of HTTP/1.1 + support, flexible per-site configuration, or content modification. The + last release from this effort was version 2.0.2-10, published in + 2000.

+ +

Then, some developers picked up the thread, and started turning the + software inside out, upside down, and then reassembled it, adding many + new features along the way.

+ +

The result of this is Privoxy, + whose first stable version, 3.0, was released August, 2002.

+
+ +
+

12.3. Authors

+ +

Current Privoxy Team:

+ +

+  Fabian Keil, lead developer
+  David Schmidt, developer
+  Hal Burgiss
+  Lee Rian
+  Roland Rosenfeld

+ +

Former Privoxy Team Members:

+ +

 Johny Agotnes
+  Rodrigo Barbosa
+  Moritz Barsnick
+  Ian Cummings
+  Brian Dessent
+  Jon Foster
+  Karsten Hopp
+  Alexander Lazic
+  Daniel Leite
+  Gábor Lipták
+  Adam Lock
+  Guy Laroche
+  Justin McMurtry
+  Mark Miller
+  Gerry Murphy
+  Andreas Oesterhelt
+  Haroon Rafique
+  Georg Sauthoff
+  Thomas Steudten
+  Jörg Strohmayer
+  Rodney Stromlund
+  Sviatoslav Sviridov
+  Sarantis Paskalis
+  Stefan Waldherr

+ +

Thanks to the many people who have tested Privoxy, reported bugs, + provided patches, made suggestions or contributed in some way. These + include (in alphabetical order):

+ +

 Ken Arromdee
+  Devin Bayer
+  Havard Berland
+  Gergely Bor
+  Francois Botha
+  Reiner Buehl
+  Andrew J. Caines
+  Clifford Caoile
+  Wan-Teh Chang
+  Billy Crook
+  Frédéric Crozat
+  Michael T. Davis
+  Mattes Dolak
+  Matthias Drochner
+  Peter E.
+  Florian Effenberger
+  Markus Elfring
+  Dean Gaudet
+  Stephen Gildea
+  Daniel Griscom
+  Felix Gröbert
+  Jeff H.
+  Aaron Hamid
+  Darel Henman
+  Magnus Holmgren
+  Eric M. Hopper
+  Ralf Horstmann
+  Stefan Huehner
+  Peter Hyman
+  Derek Jennings
+  Petr Kadlec
+  David Laight
+  Bert van Leeuwen
+  Don Libes
+  Paul Lieverse
+  Han Liu
+  Toby Lyward
+  Wil Mahan
+  Jindrich Makovicka
+  Raphael Marichez
+  Francois Marier
+  David Mediavilla
+  Raphael Moll
+  Amuro Namie
+  Adam Piggott
+  Petr Písar
+  Dan Price
+  Roberto Ragusa
+  Félix Rauch
+  Maynard Riley
+  Chung-chieh Shan
+  Spinor S.
+  Bart Schelstraete
+  Dan Stahlke
+  Oliver Stoeneberg
+  Peter Thoenen
+  Martin Thomas
+  Bobby G. Vinyard
+  Jochen Voss
+  Glenn Washburn
+  Song Weijia
+  Jörg Weinmann
+  Darren Wiebe
+  Anduin Withers
+  Oliver Yeoh
+  Jamie Zawinski

+ +

Privoxy is based in part on code originally developed by Junkbusters + Corp. and Anonymous Coders.

+ +

Privoxy heavily relies on Philip Hazel's PCRE.

+ +

The code to filter compressed content makes use of zlib which is + written by Jean-loup Gailly and Mark Adler.

+ +

On systems that lack snprintf(), Privoxy is using a version written + by Mark Martinec. On systems that lack strptime(), Privoxy is using the + one from the GNU C Library written by Ulrich Drepper.

+
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/filter-file.html privoxy-3.0.19/doc/webserver/user-manual/filter-file.html --- privoxy-3.0.17/doc/webserver/user-manual/filter-file.html 2010-11-10 21:49:47.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/filter-file.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,867 +1,407 @@ - -Filter Files - -
Privoxy 3.0.17 User Manual
PrevNext

9. Filter Files

On-the-fly text substitutions need - to be defined in a "filter file". Once defined, they - can then be invoked as an "action".

Privoxy supports three different filter actions: - filter to - rewrite the content that is send to the client, - client-header-filter - to rewrite headers that are send by the client, and - server-header-filter - to rewrite headers that are send by the server.

Privoxy also supports two tagger actions: - client-header-tagger - and - server-header-tagger. - Taggers and filters use the same syntax in the filter files, the difference - is that taggers don't modify the text they are filtering, but use a rewritten - version of the filtered text as tag. The tags can then be used to change the - applying actions through sections with tag-patterns.

Multiple filter files can be defined through the filterfile config directive. The filters - as supplied by the developers are located in - default.filter. It is recommended that any locally - defined or modified filters go in a separately defined file such as - user.filter. -

Common tasks for content filters are to eliminate common annoyances in - HTML and JavaScript, such as pop-up windows, - exit consoles, crippled windows without navigation tools, the - infamous <BLINK> tag etc, to suppress images with certain - width and height attributes (standard banner sizes or web-bugs), - or just to have fun.

Enabled content filters are applied to any content whose - "Content Type" header is recognised as a sign - of text-based content, with the exception of text/plain. - Use the force-text-mode action - to also filter other content.

Substitutions are made at the source level, so if you want to "roll - your own" filters, you should first be familiar with HTML syntax, - and, of course, regular expressions.

Just like the actions files, the - filter file is organized in sections, which are called filters - here. Each filter consists of a heading line, that starts with one of the - keywords FILTER:, - CLIENT-HEADER-FILTER: or SERVER-HEADER-FILTER: - followed by the filter's name, and a short (one line) - description of what it does. Below that line - come the jobs, i.e. lines that define the actual - text substitutions. By convention, the name of a filter - should describe what the filter eliminates. The - comment is used in the web-based - user interface.

Once a filter called name has been defined - in the filter file, it can be invoked by using an action of the form - +filter{name} - in any actions file.

Filter definitions start with a header line that contains the filter - type, the filter name and the filter description. - A content filter header line for a filter called "foo" could look - like this:

FILTER: foo Replace all "foo" with "bar"

Below that line, and up to the next header line, come the jobs that - define what text replacements the filter executes. They are specified - in a syntax that imitates Perl's - s/// operator. If you are familiar with Perl, you - will find this to be quite intuitive, and may want to look at the - PCRS documentation for the subtle differences to Perl behaviour. Most - notably, the non-standard option letter U is supported, - which turns the default to ungreedy matching.

If you are new to - "Regular - Expressions", you might want to take a look at - the Appendix on regular expressions, and - see the Perl - manual for - the - s/// operator's syntax and Perl-style regular - expressions in general. - The below examples might also help to get you started.

9.1. Filter File Tutorial

Now, let's complete our "foo" content filter. We have already defined - the heading, but the jobs are still missing. Since all it does is to replace - "foo" with "bar", there is only one (trivial) job - needed:

s/foo/bar/

But wait! Didn't the comment say that all occurrences - of "foo" should be replaced? Our current job will only take - care of the first "foo" on each page. For global substitution, - we'll need to add the g option:

s/foo/bar/g

Our complete filter now looks like this:

FILTER: foo Replace all "foo" with "bar"
-s/foo/bar/g

Let's look at some real filters for more interesting examples. Here you see - a filter that protects against some common annoyances that arise from JavaScript - abuse. Let's look at its jobs one after the other:

+ +
FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse
+
+
+
+
+  
+
+  Filter Files
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

9. Filter + Files

+ +

On-the-fly text substitutions need to be defined in a "filter file". Once defined, they can then be invoked as + an "action".

+ +

Privoxy supports three different + filter actions: filter to rewrite the content that is + send to the client, client-header-filter to + rewrite headers that are send by the client, and server-header-filter to + rewrite headers that are send by the server.

+ +

Privoxy also supports two tagger + actions: client-header-tagger + and server-header-tagger. + Taggers and filters use the same syntax in the filter files, the + difference is that taggers don't modify the text they are filtering, but + use a rewritten version of the filtered text as tag. The tags can then be + used to change the applying actions through sections with tag-patterns.

+ +

Multiple filter files can be defined through the filterfile config + directive. The filters as supplied by the developers are located in + default.filter. It is recommended that any + locally defined or modified filters go in a separately defined file such + as user.filter.

+ +

Common tasks for content filters are to eliminate common annoyances in + HTML and JavaScript, such as pop-up windows, exit consoles, crippled + windows without navigation tools, the infamous <BLINK> tag etc, to + suppress images with certain width and height attributes (standard banner + sizes or web-bugs), or just to have fun.

+ +

Enabled content filters are applied to any content whose "Content Type" header is recognised as a sign of + text-based content, with the exception of text/plain. Use the force-text-mode action to also + filter other content.

+ +

Substitutions are made at the source level, so if you want to + "roll your own" filters, you should first be + familiar with HTML syntax, and, of course, regular expressions.

+ +

Just like the actions files, the + filter file is organized in sections, which are called filters here. Each filter consists of a + heading line, that starts with one of the keywords FILTER:, + CLIENT-HEADER-FILTER: or SERVER-HEADER-FILTER: followed by the filter's + name, and a short (one line) + description of what it does. + Below that line come the jobs, + i.e. lines that define the actual text substitutions. By convention, the + name of a filter should describe what the filter eliminates. The comment is used in the + web-based user + interface.

+ +

Once a filter called name has been + defined in the filter file, it can be invoked by using an action of the + form +filter{name} in any actions file.

+ +

Filter definitions start with a header line that contains the filter + type, the filter name and the filter description. A content filter header + line for a filter called "foo" could look like + this:

+ + + + + +
+
+FILTER: foo Replace all "foo" with "bar"
+
+
+ +

Below that line, and up to the next header line, come the jobs that + define what text replacements the filter executes. They are specified in + a syntax that imitates Perl's s/// operator. If you are + familiar with Perl, you will find this to be quite intuitive, and may + want to look at the PCRS documentation for the subtle differences to Perl + behaviour. Most notably, the non-standard option letter U is supported, which turns the default to ungreedy + matching.

+ +

If you are new to "Regular Expressions", you might + want to take a look at the Appendix on + regular expressions, and see the Perl manual for + the + s/// operator's syntax and Perl-style regular + expressions in general. The below examples might also help to get you + started.

+ +
+

9.1. Filter File + Tutorial

+ +

Now, let's complete our "foo" content + filter. We have already defined the heading, but the jobs are still + missing. Since all it does is to replace "foo" with "bar", there is + only one (trivial) job needed:

+ + + + + +
+
+s/foo/bar/
+
+
+ +

But wait! Didn't the comment say that all occurrences of "foo" should be replaced? Our current job will only take + care of the first "foo" on each page. For + global substitution, we'll need to add the g + option:

+ + + + + +
+
+s/foo/bar/g
+
+
+ +

Our complete filter now looks like this:

+ + + + + +
+
+FILTER: foo Replace all "foo" with "bar"
+s/foo/bar/g
+
+
+ +

Let's look at some real filters for more interesting examples. Here + you see a filter that protects against some common annoyances that + arise from JavaScript abuse. Let's look at its jobs one after the + other:

+ + + +
+
+FILTER: js-annoyances Get rid of particularly annoying JavaScript abuse
 
 # Get rid of JavaScript referrer tracking. Test page: http://www.randomoddness.com/untitled.htm
 #
-s|(<script.*)document\.referrer(.*</script>)|$1"Not Your Business!"$2|Usg

Following the header line and a comment, you see the job. Note that it uses - | as the delimiter instead of /, because - the pattern contains a forward slash, which would otherwise have to be escaped - by a backslash (\).

Now, let's examine the pattern: it starts with the text <script.* - enclosed in parentheses. Since the dot matches any character, and * - means: "Match an arbitrary number of the element left of myself", this - matches "<script", followed by any text, i.e. - it matches the whole page, from the start of the first <script> tag.

That's more than we want, but the pattern continues: document\.referrer - matches only the exact string "document.referrer". The dot needed to - be escaped, i.e. preceded by a backslash, to take away its - special meaning as a joker, and make it just a regular dot. So far, the meaning is: - Match from the start of the first <script> tag in a the page, up to, and including, - the text "document.referrer", if both are present - in the page (and appear in that order).

But there's still more pattern to go. The next element, again enclosed in parentheses, - is .*</script>. You already know what .* - means, so the whole pattern translates to: Match from the start of the first <script> - tag in a page to the end of the last <script> tag, provided that the text - "document.referrer" appears somewhere in between.

This is still not the whole story, since we have ignored the options and the parentheses: - The portions of the page matched by sub-patterns that are enclosed in parentheses, will be - remembered and be available through the variables $1, $2, ... in - the substitute. The U option switches to ungreedy matching, which means - that the first .* in the pattern will only "eat up" all - text in between "<script" and the first occurrence - of "document.referrer", and that the second .* will - only span the text up to the first "</script>" - tag. Furthermore, the s option says that the match may span - multiple lines in the page, and the g option again means that the - substitution is global.

So, to summarize, the pattern means: Match all scripts that contain the text - "document.referrer". Remember the parts of the script from - (and including) the start tag up to (and excluding) the string - "document.referrer" as $1, and the part following - that string, up to and including the closing tag, as $2.

Now the pattern is deciphered, but wasn't this about substituting things? So - lets look at the substitute: $1"Not Your Business!"$2 is - easy to read: The text remembered as $1, followed by - "Not Your Business!" (including - the quotation marks!), followed by the text remembered as $2. - This produces an exact copy of the original string, with the middle part - (the "document.referrer") replaced by "Not Your - Business!".

The whole job now reads: Replace "document.referrer" by - "Not Your Business!" wherever it appears inside a - <script> tag. Note that this job won't break JavaScript syntax, - since both the original and the replacement are syntactically valid - string objects. The script just won't have access to the referrer - information anymore.

We'll show you two other jobs from the JavaScript taming department, but - this time only point out the constructs of special interest:

+ +
# The status bar is for displaying link targets, not pointless blahblah
+s|(<script.*)document\.referrer(.*</script>)|$1"Not Your Business!"$2|Usg
+
+
+ +

Following the header line and a comment, you see the job. Note that + it uses | as the delimiter instead of + /, because the pattern contains a forward + slash, which would otherwise have to be escaped by a backslash + (\).

+ +

Now, let's examine the pattern: it starts with the text <script.* enclosed in parentheses. Since the dot + matches any character, and * means: + "Match an arbitrary number of the element left of + myself", this matches "<script", + followed by any text, i.e. it + matches the whole page, from the start of the first <script> + tag.

+ +

That's more than we want, but the pattern continues: document\.referrer matches only the exact string + "document.referrer". The dot needed to be + escaped, i.e. preceded by a + backslash, to take away its special meaning as a joker, and make it + just a regular dot. So far, the meaning is: Match from the start of the + first <script> tag in a the page, up to, and including, the text + "document.referrer", if both are present in the page (and appear + in that order).

+ +

But there's still more pattern to go. The next element, again + enclosed in parentheses, is .*</script>. + You already know what .* means, so the whole + pattern translates to: Match from the start of the first <script> + tag in a page to the end of the last <script> tag, provided that + the text "document.referrer" appears + somewhere in between.

+ +

This is still not the whole story, since we have ignored the options + and the parentheses: The portions of the page matched by sub-patterns + that are enclosed in parentheses, will be remembered and be available + through the variables $1, $2, ... in the + substitute. The U option switches to ungreedy + matching, which means that the first .* in the + pattern will only "eat up" all text in + between "<script" and the first occurrence of "document.referrer", and that the second .* will only span the text up to the first "</script>" tag. Furthermore, the s option says that the match may span multiple lines in + the page, and the g option again means that + the substitution is global.

+ +

So, to summarize, the pattern means: Match all scripts that contain + the text "document.referrer". Remember the + parts of the script from (and including) the start tag up to (and + excluding) the string "document.referrer" as + $1, and the part following that string, up to + and including the closing tag, as $2.

+ +

Now the pattern is deciphered, but wasn't this about substituting + things? So lets look at the substitute: $1"Not Your + Business!"$2 is easy to read: The text remembered as $1, followed by "Not Your + Business!" (including + the quotation marks!), followed by the text remembered as $2. This produces an exact copy of the original string, + with the middle part (the "document.referrer") replaced by "Not Your Business!".

+ +

The whole job now reads: Replace "document.referrer" by "Not Your + Business!" wherever it appears inside a <script> tag. Note + that this job won't break JavaScript syntax, since both the original + and the replacement are syntactically valid string objects. The script + just won't have access to the referrer information anymore.

+ +

We'll show you two other jobs from the JavaScript taming department, + but this time only point out the constructs of special interest:

+ + + +
+
+# The status bar is for displaying link targets, not pointless blahblah
 #
-s/window\.status\s*=\s*(['"]).*?\1/dUmMy=1/ig

\s stands for whitespace characters (space, tab, newline, - carriage return, form feed), so that \s* means: "zero - or more whitespace". The ? in .*? - makes this matching of arbitrary text ungreedy. (Note that the U - option is not set). The ['"] construct means: "a single - or a double quote". Finally, \1 is - a back-reference to the first parenthesis just like $1 above, - with the difference that in the pattern, a backslash indicates - a back-reference, whereas in the substitute, it's the dollar.

So what does this job do? It replaces assignments of single- or double-quoted - strings to the "window.status" object with a dummy assignment - (using a variable name that is hopefully odd enough not to conflict with - real variables in scripts). Thus, it catches many cases where e.g. pointless - descriptions are displayed in the status bar instead of the link target when - you move your mouse over links.

+ +
# Kill OnUnload popups. Yummy. Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
+s/window\.status\s*=\s*(['"]).*?\1/dUmMy=1/ig
+
+
+ +

\s stands for whitespace characters (space, + tab, newline, carriage return, form feed), so that \s* means: "zero or more + whitespace". The ? in .*? makes this matching of arbitrary text ungreedy. + (Note that the U option is not set). The + ['"] construct means: "a + single or a double + quote". Finally, \1 is a back-reference + to the first parenthesis just like $1 above, + with the difference that in the pattern, a backslash indicates a + back-reference, whereas in the substitute, it's the dollar.

+ +

So what does this job do? It replaces assignments of single- or + double-quoted strings to the "window.status" + object with a dummy assignment (using a variable name that is hopefully + odd enough not to conflict with real variables in scripts). Thus, it + catches many cases where e.g. pointless descriptions are displayed in + the status bar instead of the link target when you move your mouse over + links.

+ + + +
+
+# Kill OnUnload popups. Yummy. Test: http://www.zdnet.com/zdsubs/yahoo/tree/yfs.html
 #
-s/(<body [^>]*)onunload(.*>)/$1never$2/iU

Including the - OnUnload - event binding in the HTML DOM was a CRIME. - When I close a browser window, I want it to close and die. Basta. - This job replaces the "onunload" attribute in - "<body>" tags with the dummy word never. - Note that the i option makes the pattern matching - case-insensitive. Also note that ungreedy matching alone doesn't always guarantee - a minimal match: In the first parenthesis, we had to use [^>]* - instead of .* to prevent the match from exceeding the - <body> tag if it doesn't contain "OnUnload", but the page's - content does.

The last example is from the fun department:

+ +
FILTER: fun Fun text replacements
+s/(<body [^>]*)onunload(.*>)/$1never$2/iU
+
+
+ +

Including the OnUnload event binding in the HTML DOM was a + CRIME. When I close a browser + window, I want it to close and die. Basta. This job replaces the + "onunload" attribute in "<body>" tags with the dummy word never. Note that the i option + makes the pattern matching case-insensitive. Also note that ungreedy + matching alone doesn't always guarantee a minimal match: In the first + parenthesis, we had to use [^>]* instead of + .* to prevent the match from exceeding the + <body> tag if it doesn't contain "OnUnload", but the page's content does.

+ +

The last example is from the fun department:

+ + + +
+
+FILTER: fun Fun text replacements
 
 # Spice the daily news:
 #
-s/microsoft(?!\.com)/MicroSuck/ig

Note the (?!\.com) part (a so-called negative lookahead) - in the job's pattern, which means: Don't match, if the string - ".com" appears directly following "microsoft" - in the page. This prevents links to microsoft.com from being trashed, while - still replacing the word everywhere else.

+ +
# Buzzword Bingo (example for extended regex syntax)
+s/microsoft(?!\.com)/MicroSuck/ig
+
+
+ +

Note the (?!\.com) part (a so-called + negative lookahead) in the job's pattern, which means: Don't match, if + the string ".com" appears directly following + "microsoft" in the page. This prevents links + to microsoft.com from being trashed, while still replacing the word + everywhere else.

+ + + +
+
+# Buzzword Bingo (example for extended regex syntax)
 #
 s* industry[ -]leading \
 |  cutting[ -]edge \
@@ -873,780 +413,432 @@
 |  unmatched \
 |  unparalleled \
 |  unrivalled \
-*<font color="red"><b>BINGO!</b></font> \
-*igx

The x option in this job turns on extended syntax, and allows for - e.g. the liberal use of (non-interpreted!) whitespace for nicer formatting.

You get the idea?

9.2. The Pre-defined Filters

The distribution default.filter file contains a selection of -pre-defined filters for your convenience:

js-annoyances

The purpose of this filter is to get rid of particularly annoying JavaScript abuse. - To that end, it -

  • replaces JavaScript references to the browser's referrer information - with the string "Not Your Business!". This compliments the hide-referrer action on the content level. -

  • removes the bindings to the DOM's - unload - event which we feel has no right to exist and is responsible for most "exit consoles", i.e. - nasty windows that pop up when you close another one. -

  • removes code that causes new windows to be opened with undesired properties, such as being - full-screen, non-resizeable, without location, status or menu bar etc. -

-

Use with caution. This is an aggressive filter, and can break sites that - rely heavily on JavaScript. -

js-events

This is a very radical measure. It removes virtually all JavaScript event bindings, which - means that scripts can not react to user actions such as mouse movements or clicks, window - resizing etc, anymore. Use with caution! -

We strongly discourage using this filter as a default since it breaks - many legitimate scripts. It is meant for use only on extra-nasty sites (should you really - need to go there). -

html-annoyances

This filter will undo many common instances of HTML based abuse. -

The BLINK and MARQUEE tags - are neutralized (yeah baby!), and browser windows will be created as - resizeable (as of course they should be!), and will have location, - scroll and menu bars -- even if specified otherwise. -

content-cookies

Most cookies are set in the HTTP dialog, where they can be intercepted - by the - crunch-incoming-cookies - and crunch-outgoing-cookies - actions. But web sites increasingly make use of HTML meta tags and JavaScript - to sneak cookies to the browser on the content level. -

This filter disables most HTML and JavaScript code that reads or sets - cookies. It cannot detect all clever uses of these types of code, so it - should not be relied on as an absolute fix. Use it wherever you would also - use the cookie crunch actions. -

refresh tags

Disable any refresh tags if the interval is greater than nine seconds (so - that redirections done via refresh tags are not destroyed). This is useful - for dial-on-demand setups, or for those who find this HTML feature - annoying. -

unsolicited-popups

This filter attempts to prevent only "unsolicited" pop-up - windows from opening, yet still allow pop-up windows that the user - has explicitly chosen to open. It was added in version 3.0.1, - as an improvement over earlier such filters. -

Technical note: The filter works by redefining the window.open JavaScript - function to a dummy function, PrivoxyWindowOpen(), - during the loading and rendering phase of each HTML page access, and - restoring the function afterward. -

This is recommended only for browsers that cannot perform this function - reliably themselves. And be aware that some sites require such windows - in order to function normally. Use with caution. -

all-popups

Attempt to prevent all pop-up windows from opening. - Note this should be used with even more discretion than the above, since - it is more likely to break some sites that require pop-ups for normal - usage. Use with caution. -

img-reorder

This is a helper filter that has no value if used alone. It makes the - banners-by-size and banners-by-link - (see below) filters more effective and should be enabled together with them. -

banners-by-size

This filter removes image tags purely based on what size they are. Fortunately - for us, many ads and banner images tend to conform to certain standardized - sizes, which makes this filter quite effective for ad stripping purposes. -

Occasionally this filter will cause false positives on images that are not ads, - but just happen to be of one of the standard banner sizes. -

Recommended only for those who require extreme ad blocking. The default - block rules should catch 95+% of all ads without this filter enabled. -

banners-by-link

This is an experimental filter that attempts to kill any banners if - their URLs seem to point to known or suspected click trackers. It is currently - not of much value and is not recommended for use by default. -

webbugs

Webbugs are small, invisible images (technically 1X1 GIF images), that - are used to track users across websites, and collect information on them. - As an HTML page is loaded by the browser, an embedded image tag causes the - browser to contact a third-party site, disclosing the tracking information - through the requested URL and/or cookies for that third-party domain, without - the user ever becoming aware of the interaction with the third-party site. - HTML-ized spam also uses a similar technique to verify email addresses. -

This filter removes the HTML code that loads such "webbugs". -

tiny-textforms

A rather special-purpose filter that can be used to enlarge textareas (those - multi-line text boxes in web forms) and turn off hard word wrap in them. - It was written for the sourceforge.net tracker system where such boxes are - a nuisance, but it can be handy on other sites, too. -

It is not recommended to use this filter as a default. -

jumping-windows

Many consider windows that move, or resize themselves to be abusive. This filter - neutralizes the related JavaScript code. Note that some sites might not display - or behave as intended when using this filter. Use with caution. -

frameset-borders

Some web designers seem to assume that everyone in the world will view their - web sites using the same browser brand and version, screen resolution etc, - because only that assumption could explain why they'd use static frame sizes, - yet prevent their frames from being resized by the user, should they be too - small to show their whole content. -

This filter removes the related HTML code. It should only be applied to sites - which need it. -

demoronizer

Many Microsoft products that generate HTML use non-standard extensions (read: - violations) of the ISO 8859-1 aka Latin-1 character set. This can cause those - HTML documents to display with errors on standard-compliant platforms. -

This filter translates the MS-only characters into Latin-1 equivalents. - It is not necessary when using MS products, and will cause corruption of - all documents that use 8-bit character sets other than Latin-1. It's mostly - worthwhile for Europeans on non-MS platforms, if weird garbage characters - sometimes appear on some pages, or user agents that don't correct for this on - the fly. - -

shockwave-flash

A filter for shockwave haters. As the name suggests, this filter strips code - out of web pages that is used to embed shockwave flash objects. -

quicktime-kioskmode

Change HTML code that embeds Quicktime objects so that kioskmode, which - prevents saving, is disabled. -

fun

Text replacements for subversive browsing fun. Make fun of your favorite - Monopolist or play buzzword bingo. -

crude-parental

A demonstration-only filter that shows how Privoxy - can be used to delete web content on a keyword basis. -

ie-exploits

An experimental collection of text replacements to disable malicious HTML and JavaScript - code that exploits known security holes in Internet Explorer. -

Presently, it only protects against Nimda and a cross-site scripting bug, and - would need active maintenance to provide more substantial protection. -

site-specifics

Some web sites have very specific problems, the cure for which doesn't apply - anywhere else, or could even cause damage on other sites. -

This is a collection of such site-specific cures which should only be applied - to the sites they were intended for, which is what the supplied - default.action file does. Users shouldn't need to change - anything regarding this filter. -

google

A CSS based block for Google text ads. Also removes a width limitation - and the toolbar advertisement. -

yahoo

Another CSS based block, this time for Yahoo text ads. And removes - a width limitation as well. -

msn

Another CSS based block, this time for MSN text ads. And removes - tracking URLs, as well as a width limitation. -

blogspot

Cleans up some Blogspot blogs. Read the fine print before using this one! -

This filter also intentionally removes some navigation stuff and sets the - page width to 100%. As a result, some rounded "corners" would - appear to early or not at all and as fixing this would require a browser - that understands background-size (CSS3), they are removed instead. -

xml-to-html

Server-header filter to change the Content-Type from xml to html. -

html-to-xml

Server-header filter to change the Content-Type from html to xml. -

no-ping

Removes the non-standard ping attribute from - anchor and area HTML tags. -

hide-tor-exit-notation

Client-header filter to remove the Tor exit node notation - found in Host and Referer headers. -

If Privoxy and Tor are chained and Privoxy - is configured to use socks4a, one can use "http://www.example.org.foobar.exit/" - to access the host "www.example.org" through the - Tor exit node "foobar". -

As the HTTP client isn't aware of this notation, it treats the - whole string "www.example.org.foobar.exit" as host and uses it - for the "Host" and "Referer" headers. From the - server's point of view the resulting headers are invalid and can cause problems. -

An invalid "Referer" header can trigger "hot-linking" - protections, an invalid "Host" header will make it impossible for - the server to find the right vhost (several domains hosted on the same IP address). -

This client-header filter removes the "foo.exit" part in those headers - to prevent the mentioned problems. Note that it only modifies - the HTTP headers, it doesn't make it impossible for the server - to detect your Tor exit node based on the IP address - the request is coming from. -


PrevHomeNext
Actions Files Privoxy's Template Files
\ No newline at end of file +*<font color="red"><b>BINGO!</b></font> \ +*igx +
+
+ +

The x option in this job turns on extended + syntax, and allows for e.g. the liberal use of (non-interpreted!) + whitespace for nicer formatting.

+ +

You get the idea?

+
+ +
+

9.2. The Pre-defined Filters

+ +

The distribution default.filter file + contains a selection of pre-defined filters for your convenience:

+ +
+
+
js-annoyances
+ +
+

The purpose of this filter is to get rid of particularly + annoying JavaScript abuse. To that end, it

+ +
    +
  • +

    replaces JavaScript references to the browser's referrer + information with the string "Not Your Business!". This + compliments the hide-referrer + action on the content level.

    +
  • + +
  • +

    removes the bindings to the DOM's unload event which we feel has no right to + exist and is responsible for most "exit + consoles", i.e. nasty windows that pop up when you + close another one.

    +
  • + +
  • +

    removes code that causes new windows to be opened with + undesired properties, such as being full-screen, + non-resizeable, without location, status or menu bar etc.

    +
  • +
+ +

Use with caution. This is an aggressive filter, and can break + sites that rely heavily on JavaScript.

+
+ +
js-events
+ +
+

This is a very radical measure. It removes virtually all + JavaScript event bindings, which means that scripts can not react + to user actions such as mouse movements or clicks, window + resizing etc, anymore. Use with caution!

+ +

We strongly + discourage using this filter as a default since it breaks + many legitimate scripts. It is meant for use only on extra-nasty + sites (should you really need to go there).

+
+ +
html-annoyances
+ +
+

This filter will undo many common instances of HTML based + abuse.

+ +

The BLINK and MARQUEE tags are neutralized (yeah baby!), and + browser windows will be created as resizeable (as of course they + should be!), and will have location, scroll and menu bars -- even + if specified otherwise.

+
+ +
content-cookies
+ +
+

Most cookies are set in the HTTP dialog, where they can be + intercepted by the crunch-incoming-cookies + and crunch-outgoing-cookies + actions. But web sites increasingly make use of HTML meta tags + and JavaScript to sneak cookies to the browser on the content + level.

+ +

This filter disables most HTML and JavaScript code that reads + or sets cookies. It cannot detect all clever uses of these types + of code, so it should not be relied on as an absolute fix. Use it + wherever you would also use the cookie crunch actions.

+
+ +
refresh tags
+ +
+

Disable any refresh tags if the interval is greater than nine + seconds (so that redirections done via refresh tags are not + destroyed). This is useful for dial-on-demand setups, or for + those who find this HTML feature annoying.

+
+ +
unsolicited-popups
+ +
+

This filter attempts to prevent only "unsolicited" pop-up windows from opening, yet + still allow pop-up windows that the user has explicitly chosen to + open. It was added in version 3.0.1, as an improvement over + earlier such filters.

+ +

Technical note: The filter works by redefining the window.open + JavaScript function to a dummy function, PrivoxyWindowOpen(), during the loading and + rendering phase of each HTML page access, and restoring the + function afterward.

+ +

This is recommended only for browsers that cannot perform this + function reliably themselves. And be aware that some sites + require such windows in order to function normally. Use with + caution.

+
+ +
all-popups
+ +
+

Attempt to prevent all pop-up windows from opening. + Note this should be used with even more discretion than the + above, since it is more likely to break some sites that require + pop-ups for normal usage. Use with caution.

+
+ +
img-reorder
+ +
+

This is a helper filter that has no value if used alone. It + makes the banners-by-size and banners-by-link (see below) filters more effective + and should be enabled together with them.

+
+ +
banners-by-size
+ +
+

This filter removes image tags purely based on what size they + are. Fortunately for us, many ads and banner images tend to + conform to certain standardized sizes, which makes this filter + quite effective for ad stripping purposes.

+ +

Occasionally this filter will cause false positives on images + that are not ads, but just happen to be of one of the standard + banner sizes.

+ +

Recommended only for those who require extreme ad blocking. + The default block rules should catch 95+% of all ads without this filter enabled.

+
+ +
banners-by-link
+ +
+

This is an experimental filter that attempts to kill any + banners if their URLs seem to point to known or suspected click + trackers. It is currently not of much value and is not + recommended for use by default.

+
+ +
webbugs
+ +
+

Webbugs are small, invisible images (technically 1X1 GIF + images), that are used to track users across websites, and + collect information on them. As an HTML page is loaded by the + browser, an embedded image tag causes the browser to contact a + third-party site, disclosing the tracking information through the + requested URL and/or cookies for that third-party domain, without + the user ever becoming aware of the interaction with the + third-party site. HTML-ized spam also uses a similar technique to + verify email addresses.

+ +

This filter removes the HTML code that loads such "webbugs".

+
+ +
tiny-textforms
+ +
+

A rather special-purpose filter that can be used to enlarge + textareas (those multi-line text boxes in web forms) and turn off + hard word wrap in them. It was written for the sourceforge.net + tracker system where such boxes are a nuisance, but it can be + handy on other sites, too.

+ +

It is not recommended to use this filter as a default.

+
+ +
jumping-windows
+ +
+

Many consider windows that move, or resize themselves to be + abusive. This filter neutralizes the related JavaScript code. + Note that some sites might not display or behave as intended when + using this filter. Use with caution.

+
+ +
frameset-borders
+ +
+

Some web designers seem to assume that everyone in the world + will view their web sites using the same browser brand and + version, screen resolution etc, because only that assumption + could explain why they'd use static frame sizes, yet prevent + their frames from being resized by the user, should they be too + small to show their whole content.

+ +

This filter removes the related HTML code. It should only be + applied to sites which need it.

+
+ +
demoronizer
+ +
+

Many Microsoft products that generate HTML use non-standard + extensions (read: violations) of the ISO 8859-1 aka Latin-1 + character set. This can cause those HTML documents to display + with errors on standard-compliant platforms.

+ +

This filter translates the MS-only characters into Latin-1 + equivalents. It is not necessary when using MS products, and will + cause corruption of all documents that use 8-bit character sets + other than Latin-1. It's mostly worthwhile for Europeans on + non-MS platforms, if weird garbage characters sometimes appear on + some pages, or user agents that don't correct for this on the + fly.

+
+ +
shockwave-flash
+ +
+

A filter for shockwave haters. As the name suggests, this + filter strips code out of web pages that is used to embed + shockwave flash objects.

+
+ +
quicktime-kioskmode
+ +
+

Change HTML code that embeds Quicktime objects so that + kioskmode, which prevents saving, is disabled.

+
+ +
fun
+ +
+

Text replacements for subversive browsing fun. Make fun of + your favorite Monopolist or play buzzword bingo.

+
+ +
crude-parental
+ +
+

A demonstration-only filter that shows how Privoxy can be used to delete web content on + a keyword basis.

+
+ +
ie-exploits
+ +
+

An experimental collection of text replacements to disable + malicious HTML and JavaScript code that exploits known security + holes in Internet Explorer.

+ +

Presently, it only protects against Nimda and a cross-site + scripting bug, and would need active maintenance to provide more + substantial protection.

+
+ +
site-specifics
+ +
+

Some web sites have very specific problems, the cure for which + doesn't apply anywhere else, or could even cause damage on other + sites.

+ +

This is a collection of such site-specific cures which should + only be applied to the sites they were intended for, which is + what the supplied default.action file + does. Users shouldn't need to change anything regarding this + filter.

+
+ +
google
+ +
+

A CSS based block for Google text ads. Also removes a width + limitation and the toolbar advertisement.

+
+ +
yahoo
+ +
+

Another CSS based block, this time for Yahoo text ads. And + removes a width limitation as well.

+
+ +
msn
+ +
+

Another CSS based block, this time for MSN text ads. And + removes tracking URLs, as well as a width limitation.

+
+ +
blogspot
+ +
+

Cleans up some Blogspot blogs. Read the fine print before + using this one!

+ +

This filter also intentionally removes some navigation stuff + and sets the page width to 100%. As a result, some rounded + "corners" would appear to early or not + at all and as fixing this would require a browser that + understands background-size (CSS3), they are removed instead.

+
+ +
xml-to-html
+ +
+

Server-header filter to change the Content-Type from xml to + html.

+
+ +
html-to-xml
+ +
+

Server-header filter to change the Content-Type from html to + xml.

+
+ +
no-ping
+ +
+

Removes the non-standard ping + attribute from anchor and area HTML tags.

+
+ +
hide-tor-exit-notation
+ +
+

Client-header filter to remove the Tor + exit node notation found in Host and Referer headers.

+ +

If Privoxy and Tor are chained and Privoxy is configured to use socks4a, one + can use "http://www.example.org.foobar.exit/" to access + the host "www.example.org" through the + Tor exit node "foobar".

+ +

As the HTTP client isn't aware of this notation, it treats the + whole string "www.example.org.foobar.exit" as host and uses it + for the "Host" and "Referer" headers. From the server's point of view + the resulting headers are invalid and can cause problems.

+ +

An invalid "Referer" header can + trigger "hot-linking" protections, an + invalid "Host" header will make it + impossible for the server to find the right vhost (several + domains hosted on the same IP address).

+ +

This client-header filter removes the "foo.exit" part in those headers to prevent the + mentioned problems. Note that it only modifies the HTTP headers, + it doesn't make it impossible for the server to detect your + Tor exit node based on the IP address the + request is coming from.

+
+
+
+
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/index.html privoxy-3.0.19/doc/webserver/user-manual/index.html --- privoxy-3.0.17/doc/webserver/user-manual/index.html 2010-11-13 12:51:44.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/index.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,1012 +1,621 @@ - -Privoxy 3.0.17 User Manual - -

Privoxy 3.0.17 User Manual

Copyright Š 2001-2010 by - Privoxy Developers -

$Id: index.html,v 1.75 2010/11/13 12:51:44 fabiankeil Exp $

The Privoxy User Manual gives users information on how to - install, configure and use Privoxy. -

Privoxy is a non-caching web proxy with advanced filtering capabilities - for enhancing privacy, modifying web page data and HTTP headers, controlling - access, and removing ads and other obnoxious Internet junk. Privoxy has a - flexible configuration and can be customized to suit individual needs and tastes. - It has application for both stand-alone systems and multi-user networks.

Privoxy is Free Software and licensed under the GNU GPLv2.

Privoxy is an associated project of Software in the Public Interest (SPI).

Helping hands and donations are welcome: -

You can find the latest version of the Privoxy User Manual at http://www.privoxy.org/user-manual/. - Please see the Contact section on how to - contact the developers. -


Table of Contents
1. Introduction
1.1. Features
2. Installation
2.1. Binary Packages
2.1.1. Red Hat and Fedora RPMs
2.1.2. Debian and Ubuntu
2.1.3. Windows
2.1.4. Solaris
2.1.5. OS/2
2.1.6. Mac OS X
2.1.7. AmigaOS
2.1.8. FreeBSD
2.1.9. Gentoo
2.2. Building from Source
2.3. Keeping your Installation Up-to-Date
3. What's New in this Release
3.1. Note to Upgraders
4. Quickstart to Using Privoxy
4.1. Quickstart to Ad Blocking
5. Starting Privoxy
5.1. Red Hat and Fedora
5.2. Debian
5.3. Windows
5.4. Solaris, NetBSD, FreeBSD, HP-UX and others
5.5. OS/2
5.6. Mac OS X
5.7. AmigaOS
5.8. Gentoo
5.9. Command Line Options
6. Privoxy Configuration
6.1. Controlling Privoxy with Your Web Browser
6.2. Configuration Files Overview
7. The Main Configuration File
7.1. Local Set-up Documentation
7.1.1. user-manual
7.1.2. trust-info-url
7.1.3. admin-address
7.1.4. proxy-info-url
7.2. Configuration and Log File Locations
7.2.1. confdir
7.2.2. templdir
7.2.3. logdir
7.2.4. actionsfile
7.2.5. filterfile
7.2.6. logfile
7.2.7. trustfile
7.3. Debugging
7.3.1. debug
7.3.2. single-threaded
7.3.3. hostname
7.4. Access Control and Security
7.4.1. listen-address
7.4.2. toggle
7.4.3. enable-remote-toggle
7.4.4. enable-remote-http-toggle
7.4.5. enable-edit-actions
7.4.6. enforce-blocks
7.4.7. ACLs: permit-access and deny-access
7.4.8. buffer-limit
7.5. Forwarding
7.5.1. forward
7.5.2. forward-socks4, forward-socks4a and forward-socks5
7.5.3. Advanced Forwarding Examples
7.5.4. forwarded-connect-retries
7.6. Miscellaneous
7.6.1. accept-intercepted-requests
7.6.2. allow-cgi-request-crunching
7.6.3. split-large-forms
7.6.4. keep-alive-timeout
7.6.5. default-server-timeout
7.6.6. connection-sharing
7.6.7. socket-timeout
7.6.8. max-client-connections
7.6.9. handle-as-empty-doc-returns-ok
7.7. Windows GUI Options
8. Actions Files
8.1. Finding the Right Mix
8.2. How to Edit
8.3. How Actions are Applied to Requests
8.4. Patterns
8.4.1. The Domain Pattern
8.4.2. The Path Pattern
8.4.3. The Tag Pattern
8.5. Actions
8.5.1. add-header
8.5.2. block
8.5.3. change-x-forwarded-for
8.5.4. client-header-filter
8.5.5. client-header-tagger
8.5.6. content-type-overwrite
8.5.7. crunch-client-header
8.5.8. crunch-if-none-match
8.5.9. crunch-incoming-cookies
8.5.10. crunch-server-header
8.5.11. crunch-outgoing-cookies
8.5.12. deanimate-gifs
8.5.13. downgrade-http-version
8.5.14. fast-redirects
8.5.15. filter
8.5.16. force-text-mode
8.5.17. forward-override
8.5.18. handle-as-empty-document
8.5.19. handle-as-image
8.5.20. hide-accept-language
8.5.21. hide-content-disposition
8.5.22. hide-if-modified-since
8.5.23. hide-from-header
8.5.24. hide-referrer
8.5.25. hide-user-agent
8.5.26. limit-connect
8.5.27. prevent-compression
8.5.28. overwrite-last-modified
8.5.29. redirect
8.5.30. server-header-filter
8.5.31. server-header-tagger
8.5.32. session-cookies-only
8.5.33. set-image-blocker
8.5.34. Summary
8.6. Aliases
8.7. Actions Files Tutorial
8.7.1. match-all.action
8.7.2. default.action
8.7.3. user.action
9. Filter Files
9.1. Filter File Tutorial
9.2. The Pre-defined Filters
10. Privoxy's Template Files
11. Contacting the Developers, Bug Reporting and Feature -Requests
11.1. Get Support
11.2. Reporting Problems
11.2.1. Reporting Ads or Other Configuration Problems
11.2.2. Reporting Bugs
11.3. Request New Features
11.4. Mailing Lists
12. Privoxy Copyright, License and History
12.1. License
12.2. History
12.3. Authors
13. See Also
14. Appendix
14.1. Regular Expressions
14.2. Privoxy's Internal Pages
14.2.1. Bookmarklets
14.3. Chain of Events
14.4. Troubleshooting: Anatomy of an Action

  Next
  Introduction
+ + + + + + + Privoxy 3.0.19 User Manual + + + + + + + + + +
+
+

Privoxy 3.0.19 User + Manual

+ +

Copyright © + 2001-2011 by Privoxy + Developers

+ +

$Id: user-manual.sgml,v 2.143 2011/11/20 17:16:36 + fabiankeil Exp $

+ +
+ + +

The Privoxy User Manual gives users + information on how to install, configure and use Privoxy.

+ +

Privoxy is a non-caching web proxy with advanced filtering + capabilities for enhancing privacy, modifying web page data and HTTP + headers, controlling access, and removing ads and other obnoxious + Internet junk. Privoxy has a flexible configuration and can be + customized to suit individual needs and tastes. It has application + for both stand-alone systems and multi-user networks.

+ +

Privoxy is Free Software and licensed under the GNU GPLv2.

+ +

Privoxy is an associated project of Software in the Public + Interest (SPI).

+ +

Helping hands and donations are welcome:

+ + + +

You can find the latest version of the Privoxy User Manual at http://www.privoxy.org/user-manual/. Please see the + Contact section on how to contact the + developers.

+
+
+
+ +
+
+
Table of Contents
+ +
1. Introduction
+ +
+
+
1.1. Features
+
+
+ +
2. Installation
+ +
+
+
2.1. Binary + Packages
+ +
+
+
2.1.1. Red Hat and Fedora + RPMs
+ +
2.1.2. Debian and + Ubuntu
+ +
2.1.3. Windows
+ +
2.1.4. Solaris
+ +
2.1.5. OS/2
+ +
2.1.6. Mac + OS X
+ +
2.1.7. AmigaOS
+ +
2.1.8. FreeBSD
+ +
2.1.9. Gentoo
+
+
+ +
2.2. Building + from Source
+ +
2.3. Keeping your + Installation Up-to-Date
+
+
+ +
3. What's New in this Release
+ +
+
+
3.1. Note to + Upgraders
+
+
+ +
4. Quickstart to Using Privoxy
+ +
+
+
4.1. Quickstart to Ad + Blocking
+
+
+ +
5. Starting Privoxy
+ +
+
+
5.1. Red Hat and + Fedora
+ +
5.2. Debian
+ +
5.3. Windows
+ +
5.4. Solaris, NetBSD, + FreeBSD, HP-UX and others
+ +
5.5. OS/2
+ +
5.6. Mac OS X
+ +
5.7. AmigaOS
+ +
5.8. Gentoo
+ +
5.9. Command Line + Options
+
+
+ +
6. Privoxy Configuration
+ +
+
+
6.1. Controlling Privoxy + with Your Web Browser
+ +
6.2. Configuration + Files Overview
+
+
+ +
7. The Main Configuration File
+ +
+
+
7.1. Local Set-up + Documentation
+ +
+
+
7.1.1. user-manual
+ +
7.1.2. trust-info-url
+ +
7.1.3. admin-address
+ +
7.1.4. proxy-info-url
+
+
+ +
7.2. Configuration and Log + File Locations
+ +
+
+
7.2.1. confdir
+ +
7.2.2. templdir
+ +
7.2.3. logdir
+ +
7.2.4. actionsfile
+ +
7.2.5. filterfile
+ +
7.2.6. logfile
+ +
7.2.7. trustfile
+
+
+ +
7.3. Debugging
+ +
+
+
7.3.1. debug
+ +
7.3.2. single-threaded
+ +
7.3.3. hostname
+
+
+ +
7.4. Access Control and + Security
+ +
+
+
7.4.1. listen-address
+ +
7.4.2. toggle
+ +
7.4.3. enable-remote-toggle
+ +
7.4.4. enable-remote-http-toggle
+ +
7.4.5. enable-edit-actions
+ +
7.4.6. enforce-blocks
+ +
7.4.7. ACLs: permit-access and + deny-access
+ +
7.4.8. buffer-limit
+
+
+ +
7.5. Forwarding
+ +
+
+
7.5.1. forward
+ +
7.5.2. forward-socks4, + forward-socks4a and forward-socks5
+ +
7.5.3. Advanced + Forwarding Examples
+ +
7.5.4. forwarded-connect-retries
+
+
+ +
7.6. Miscellaneous
+ +
+
+
7.6.1. accept-intercepted-requests
+ +
7.6.2. allow-cgi-request-crunching
+ +
7.6.3. split-large-forms
+ +
7.6.4. keep-alive-timeout
+ +
7.6.5. default-server-timeout
+ +
7.6.6. connection-sharing
+ +
7.6.7. socket-timeout
+ +
7.6.8. max-client-connections
+ +
7.6.9. handle-as-empty-doc-returns-ok
+ +
7.6.10. enable-compression
+ +
7.6.11. compression-level
+
+
+ +
7.7. Windows GUI + Options
+
+
+ +
8. Actions Files
+ +
+
+
8.1. Finding the Right + Mix
+ +
8.2. How to Edit
+ +
8.3. How Actions + are Applied to Requests
+ +
8.4. Patterns
+ +
+
+
8.4.1. The Domain + Pattern
+ +
8.4.2. The Path + Pattern
+ +
8.4.3. The Tag + Pattern
+
+
+ +
8.5. Actions
+ +
+
+
8.5.1. add-header
+ +
8.5.2. block
+ +
8.5.3. change-x-forwarded-for
+ +
8.5.4. client-header-filter
+ +
8.5.5. client-header-tagger
+ +
8.5.6. content-type-overwrite
+ +
8.5.7. crunch-client-header
+ +
8.5.8. crunch-if-none-match
+ +
8.5.9. crunch-incoming-cookies
+ +
8.5.10. crunch-server-header
+ +
8.5.11. crunch-outgoing-cookies
+ +
8.5.12. deanimate-gifs
+ +
8.5.13. downgrade-http-version
+ +
8.5.14. fast-redirects
+ +
8.5.15. filter
+ +
8.5.16. force-text-mode
+ +
8.5.17. forward-override
+ +
8.5.18. handle-as-empty-document
+ +
8.5.19. handle-as-image
+ +
8.5.20. hide-accept-language
+ +
8.5.21. hide-content-disposition
+ +
8.5.22. hide-if-modified-since
+ +
8.5.23. hide-from-header
+ +
8.5.24. hide-referrer
+ +
8.5.25. hide-user-agent
+ +
8.5.26. limit-connect
+ +
8.5.27. prevent-compression
+ +
8.5.28. overwrite-last-modified
+ +
8.5.29. redirect
+ +
8.5.30. server-header-filter
+ +
8.5.31. server-header-tagger
+ +
8.5.32. session-cookies-only
+ +
8.5.33. set-image-blocker
+ +
8.5.34. Summary
+
+
+ +
8.6. Aliases
+ +
8.7. Actions Files + Tutorial
+ +
+
+
8.7.1. match-all.action
+ +
8.7.2. default.action
+ +
8.7.3. user.action
+
+
+
+
+ +
9. Filter Files
+ +
+
+
9.1. Filter File + Tutorial
+ +
9.2. The + Pre-defined Filters
+
+
+ +
10. Privoxy's Template Files
+ +
11. Contacting the Developers, Bug + Reporting and Feature Requests
+ +
+
+
11.1. Get + Support
+ +
11.2. Reporting + Problems
+ +
+
+
11.2.1. Reporting Ads + or Other Configuration Problems
+ +
11.2.2. Reporting + Bugs
+
+
+ +
11.3. Request New + Features
+ +
11.4. Mailing + Lists
+
+
+ +
12. Privoxy Copyright, License and + History
+ +
+
+
12.1. License
+ +
12.2. History
+ +
12.3. Authors
+
+
+ +
13. See Also
+ +
14. Appendix
+ +
+
+
14.1. Regular + Expressions
+ +
14.2. Privoxy's Internal + Pages
+ +
+
+
14.2.1. Bookmarklets
+
+
+ +
14.3. Chain of Events
+ +
14.4. Troubleshooting: + Anatomy of an Action
+
+
+
+
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/installation.html privoxy-3.0.19/doc/webserver/user-manual/installation.html --- privoxy-3.0.17/doc/webserver/user-manual/installation.html 2010-11-13 12:51:20.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/installation.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,1082 +1,563 @@ - -Installation - -
Privoxy 3.0.17 User Manual
PrevNext

2. Installation

Privoxy is available both in convenient pre-compiled - packages for a wide range of operating systems, and as raw source code. - For most users, we recommend using the packages, which can be downloaded from our - Privoxy Project - Page.

Note: - On some platforms, the installer may remove previously installed versions, if - found. (See below for your platform). In any case be sure to backup - your old configuration if it is valuable to you. See the note to upgraders section below.

2.1. Binary Packages

How to install the binary packages depends on your operating system:

2.1.1. Red Hat and Fedora RPMs

RPMs can be installed with rpm -Uvh privoxy-3.0.17-1.rpm, - and will use /etc/privoxy for the location - of configuration files.

Note that on Red Hat, Privoxy will - not be automatically started on system boot. You will - need to enable that using chkconfig, - ntsysv, or similar methods.

If you have problems with failed dependencies, try rebuilding the SRC RPM: - rpm --rebuild privoxy-3.0.17-1.src.rpm. This - will use your locally installed libraries and RPM version.

Also note that if you have a Junkbuster RPM installed - on your system, you need to remove it first, because the packages conflict. - Otherwise, RPM will try to remove Junkbuster - automatically if found, before installing Privoxy.

2.1.2. Debian and Ubuntu

DEBs can be installed with apt-get install privoxy, - and will use /etc/privoxy for the location of - configuration files.

2.1.3. Windows

Just double-click the installer, which will guide you through - the installation process. You will find the configuration files - in the same directory as you installed Privoxy in.

Version 3.0.5 beta introduced full Windows service - functionality. On Windows only, the Privoxy - program has two new command line arguments to install and uninstall - Privoxy as a service.

Arguments:

--install[:service_name] -

--uninstall[:service_name] -

After invoking Privoxy with - --install, you will need to bring up the - Windows service console to assign the user you - want Privoxy to run under, and whether or not you - want it to run whenever the system starts. You can start the - Windows services console with the following - command: services.msc. If you do not take the manual step - of modifying Privoxy's service settings, it will - not start. Note too that you will need to give Privoxy a user account that - actually exists, or it will not be permitted to - write to its log and configuration files.

2.1.4. Solaris

Create a new directory, cd to it, then unzip and - untar the archive. For the most part, you'll have to figure out where - things go.

2.1.5. OS/2

First, make sure that no previous installations of - Junkbuster and / or - Privoxy are left on your - system. Check that no Junkbuster - or Privoxy objects are in - your startup folder.

Then, just double-click the WarpIN self-installing archive, which will - guide you through the installation process. A shadow of the - Privoxy executable will be placed in your - startup folder so it will start automatically whenever OS/2 starts.

The directory you choose to install Privoxy - into will contain all of the configuration files.

2.1.6. Mac OS X

Unzip the downloaded file (you can either double-click on the zip file - icon from the Finder, or from the desktop if you downloaded it there). - Then, double-click on the package installer icon and follow the - installation process.

The privoxy service will automatically start after a successful - installation (in addition to every time your computer starts up). To - prevent the privoxy service from automatically starting when your - computer starts up, remove or rename the folder named - /Library/StartupItems/Privoxy.

To manually start or stop the privoxy service, use the Privoxy Utility - for Mac OS X. This application controls the privoxy service (e.g. - starting and stopping the service as well as uninstalling the software).

2.1.7. AmigaOS

Copy and then unpack the lha archive to a suitable location. - All necessary files will be installed into Privoxy - directory, including all configuration and log files. To uninstall, just - remove this directory.

2.1.8. FreeBSD

Privoxy is part of FreeBSD's Ports Collection, you can build and install - it with cd /usr/ports/www/privoxy; make install clean.

If you don't use the ports, you can fetch and install - the package with pkg_add -r privoxy.

The port skeleton and the package can also be downloaded from the - File Release - Page, but there's no reason to use them unless you're interested in the - beta releases which are only available there.

2.1.9. Gentoo

Gentoo source packages (Ebuilds) for Privoxy are - contained in the Gentoo Portage Tree (they are not on the download page, - but there is a Gentoo section, where you can see when a new - Privoxy Version is added to the Portage Tree).

Before installing Privoxy under Gentoo just do - first emerge --sync to get the latest changes from the - Portage tree. With emerge privoxy you install the latest - version.

Configuration files are in /etc/privoxy, the - documentation is in /usr/share/doc/privoxy-3.0.17 - and the Log directory is in /var/log/privoxy.

2.2. Building from Source

The most convenient way to obtain the Privoxy sources - is to download the source tarball from our - project download - page.

If you like to live on the bleeding edge and are not afraid of using - possibly unstable development versions, you can check out the up-to-the-minute - version directly from the - CVS repository.

To build Privoxy from source, - autoconf, - GNU make - (gmake), and, of course, a C compiler like gcc are required.

When building from a source tarball, - first unpack the source:

 tar xzvf privoxy-3.0.17-stable-src.tar.gz
- cd privoxy-3.0.17-stable

For retrieving the current CVS sources, you'll need a CVS client installed. - Note that sources from CVS are typically development quality, and may not be - stable, or well tested. To download CVS source, check the Sourceforge - documentation, which might give commands like:

+ +
  cvs -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa login
+
+
+
+
+  
+
+  Installation
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

2. + Installation

+ +

Privoxy is available both in + convenient pre-compiled packages for a wide range of operating systems, + and as raw source code. For most users, we recommend using the packages, + which can be downloaded from our Privoxy Project + Page.

+ +

Note: On some platforms, the installer may remove previously installed + versions, if found. (See below for your platform). In any case + be sure to backup your old + configuration if it is valuable to you. See the note to upgraders section below.

+ +
+

2.1. Binary Packages

+ +

How to install the binary packages depends on your operating + system:

+ +
+

2.1.1. Red Hat and Fedora RPMs

+ +

RPMs can be installed with rpm -Uvh + privoxy-3.0.19-1.rpm, and will use /etc/privoxy for the location of configuration + files.

+ +

Note that on Red Hat, Privoxy + will not be automatically + started on system boot. You will need to enable that using chkconfig, ntsysv, or similar + methods.

+ +

If you have problems with failed dependencies, try rebuilding the + SRC RPM: rpm --rebuild + privoxy-3.0.19-1.src.rpm. This will use your locally installed + libraries and RPM version.

+ +

Also note that if you have a Junkbuster RPM installed on your system, you + need to remove it first, because the packages conflict. Otherwise, + RPM will try to remove Junkbuster + automatically if found, before installing Privoxy.

+
+ +
+

2.1.2. Debian and Ubuntu

+ +

DEBs can be installed with apt-get install + privoxy, and will use /etc/privoxy for + the location of configuration files.

+
+ +
+

2.1.3. Windows

+ +

Just double-click the installer, which will guide you through the + installation process. You will find the configuration files in the + same directory as you installed Privoxy in.

+ +

Version 3.0.5 beta introduced full Windows service functionality. On Windows only, + the Privoxy program has two new + command line arguments to install and uninstall Privoxy as a service.

+ +
+
+
Arguments:
+ +
+

--install[:service_name]

+ +

--uninstall[:service_name]

+
+
+
+ +

After invoking Privoxy with + --install, you will need to bring up the + Windows service console to assign + the user you want Privoxy to run + under, and whether or not you want it to run whenever the system + starts. You can start the Windows + services console with the following command: services.msc. If you do not take the manual step of + modifying Privoxy's service + settings, it will not start. Note too that you will need to give + Privoxy a user account that actually exists, or it will not be + permitted to write to its log and configuration files.

+
+ +
+

2.1.4. Solaris

+ +

Create a new directory, cd to it, then + unzip and untar the archive. For the most part, you'll have to figure + out where things go.

+
+ +
+

2.1.5. OS/2

+ +

First, make sure that no previous installations of Junkbuster and / or Privoxy are left on your system. Check that no + Junkbuster or Privoxy objects are in your startup folder.

+ +

Then, just double-click the WarpIN self-installing archive, which + will guide you through the installation process. A shadow of the + Privoxy executable will be placed in + your startup folder so it will start automatically whenever OS/2 + starts.

+ +

The directory you choose to install Privoxy into will contain all of the + configuration files.

+
+ +
+

2.1.6. Mac OS X

+ +

Unzip the downloaded file (you can either double-click on the zip + file icon from the Finder, or from the desktop if you downloaded it + there). Then, double-click on the package installer icon and follow + the installation process.

+ +

The privoxy service will automatically start after a successful + installation (in addition to every time your computer starts up). To + prevent the privoxy service from automatically starting when your + computer starts up, remove or rename the folder named /Library/StartupItems/Privoxy.

+ +

To manually start or stop the privoxy service, use the Privoxy + Utility for Mac OS X. This application controls the privoxy service + (e.g. starting and stopping the service as well as uninstalling the + software).

+
+ +
+

2.1.7. AmigaOS

+ +

Copy and then unpack the lha archive to + a suitable location. All necessary files will be installed into + Privoxy directory, including all + configuration and log files. To uninstall, just remove this + directory.

+
+ +
+

2.1.8. FreeBSD

+ +

Privoxy is part of FreeBSD's Ports Collection, you can build and + install it with cd /usr/ports/www/privoxy; make + install clean.

+ +

If you don't use the ports, you can fetch and install the package + with pkg_add -r privoxy.

+ +

The port skeleton and the package can also be downloaded from the + File Release Page, but there's no reason to use + them unless you're interested in the beta releases which are only + available there.

+
+ +
+

2.1.9. Gentoo

+ +

Gentoo source packages (Ebuilds) for Privoxy are contained in the Gentoo Portage Tree + (they are not on the download page, but there is a Gentoo section, + where you can see when a new Privoxy + Version is added to the Portage Tree).

+ +

Before installing Privoxy under + Gentoo just do first emerge --sync to get + the latest changes from the Portage tree. With emerge privoxy you install the latest version.

+ +

Configuration files are in /etc/privoxy, + the documentation is in /usr/share/doc/privoxy-3.0.19 and the Log directory + is in /var/log/privoxy.

+
+
+ +
+

2.2. Building from Source

+ +

The most convenient way to obtain the Privoxy sources is to download the source tarball + from our project download page.

+ +

If you like to live on the bleeding edge and are not afraid of using + possibly unstable development versions, you can check out the + up-to-the-minute version directly from the CVS + repository.

+ +

To build Privoxy from source, + autoconf, GNU make + (gmake), and, of course, a C compiler like gcc are + required.

+ +

When building from a source tarball, first unpack the source:

+ + + + + +
+
+ tar xzvf privoxy-3.0.19-stable-src.tar.gz
+ cd privoxy-3.0.19-stable
+
+
+ +

For retrieving the current CVS sources, you'll need a CVS client + installed. Note that sources from CVS are typically development + quality, and may not be stable, or well tested. To download CVS source, + check the Sourceforge documentation, which might give commands + like:

+ + + +
+
+  cvs -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa login
   cvs -z3 -d:pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa co current
-  cd current

This will create a directory named current/, which will - contain the source tree.

You can also check out any Privoxy - "branch", just exchange the current - name with the wanted branch name (Example: v_3_0_branch for the 3.0 cvs - tree).

It is also strongly recommended to not run Privoxy - as root. You should configure/install/run Privoxy as - an unprivileged user, preferably by creating a "privoxy" user - and group just for this purpose. See your local documentation for the correct - command line to do add new users and groups (something like - adduser, but the command syntax may vary from platform - to platform).

/etc/passwd might then look like:

  privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell

And then /etc/group, like:

  privoxy:*:7777:

Some binary packages may do this for you.

Then, to build from either unpacked tarball or CVS source:

+ +
 autoheader
+  cd current
+
+
+ +

This will create a directory named current/, which will contain the source tree.

+ +

You can also check out any Privoxy + "branch", just exchange the current name with the wanted branch name (Example: + v_3_0_branch for the 3.0 cvs tree).

+ +

It is also strongly recommended to not run Privoxy as root. You should configure/install/run + Privoxy as an unprivileged user, + preferably by creating a "privoxy" user and + group just for this purpose. See your local documentation for the + correct command line to do add new users and groups (something like + adduser, but the command syntax may vary from + platform to platform).

+ +

/etc/passwd might then look like:

+ + + + + +
+
+  privoxy:*:7777:7777:privoxy proxy:/no/home:/no/shell
+
+
+ +

And then /etc/group, like:

+ + + + + +
+
+  privoxy:*:7777:
+
+
+ +

Some binary packages may do this for you.

+ +

Then, to build from either unpacked tarball or CVS source:

+ + + +
+
+ autoheader
  autoconf
  ./configure      # (--help to see options)
- make             # (the make from GNU, sometimes called gmake) 
+ make             # (the make from GNU, sometimes called gmake)
  su               # Possibly required
  make -n install  # (to see where all the files will go)
- make -s install  # (to really install, -s to silence output)

Using GNU make, you can have the first four steps - automatically done for you by just typing:

  make

in the freshly downloaded or unpacked source directory.

To build an executable with security enhanced features so that - users cannot easily bypass the proxy (e.g. "Go There Anyway"), or - alter their own configurations, configure like this:

 ./configure  --disable-toggle  --disable-editor  --disable-force

Then build as above. In Privoxy 3.0.7 and later, all of these options -can also be disabled through the configuration file.

WARNING: If installing as root, the install will fail - unless a non-root user or group is specified, or a privoxy - user and group already exist on the system. If a non-root user is specified, - and no group, then the installation will try to also use a group of the same name - as "user". If a group is specified (and no user), then the - support files will be installed as writable by that group, and owned by the - user running the installation.

configure accepts --with-user and - --with-group options for setting user and group ownership - of the configuration files (which need to be writable by the daemon). The - specified user must already exist. When starting - Privoxy, it must be run as this same user to - insure write access to configuration and log files!

Alternately, you can specify user and group - on the make command line, but be sure both already exist:

 make -s install  USER=privoxy GROUP=privoxy

The default installation path for make install is - /usr/local. This may of course be customized with - the various ./configure path options. If you are doing - an install to anywhere besides /usr/local, be - sure to set the appropriate paths with the correct configure options - (./configure --help). Non-privileged users must of course - have write access permissions to wherever the target installation is going.

If you do install to /usr/local, the install will use - sysconfdir=$prefix/etc/privoxy by default. All other - destinations, and the direct usage of --sysconfdir flag - behave like normal, i.e. will not add the extra privoxy - directory. This is for a safer install, as there may already exist another - program that uses a file with the "config" name, and thus makes - /usr/local/etc cleaner.

If installing to /usr/local, the documentation will go - by default to $prefix/share/doc. But if this directory - doesn't exist, it will then try $prefix/doc and install - there before creating a new $prefix/share/doc just for - Privoxy.

Again, if the installs goes to /usr/local, the - localstatedir (ie: var/) will default - to /var instead of $prefix/var so - the logs will go to /var/log/privoxy/, and the pid file - will be created in /var/run/privoxy.pid.

make install will attempt to set the correct values - in config (main configuration file). You should - check this to make sure all values are correct. If appropriate, - an init script will be installed, but it is up to the user to determine - how and where to start Privoxy. The init - script should be checked for correct paths and values, if anything other than - a default install is done.

If install finds previous versions of local configuration files, most of - these will not be overwritten, and the new ones will be installed with a - "new" extension. default.action and default.filter - will be overwritten. You will then need - to manually update the other installed configuration files as needed. The - default template files will be overwritten. If you have - customized, local templates, these should be stored safely in a separate - directory and defined in config by the - "templdir" directive. It is of course wise to always back-up any - important configuration files "just in case". If a previous - version of Privoxy is already running, you will - have to restart it manually.

For more detailed instructions on how to build Redhat RPMs, - Windows self-extracting installers, building on platforms with - special requirements etc, please consult the developer manual.

2.3. Keeping your Installation Up-to-Date

As user feedback comes in and development continues, we will make updated versions - of both the main actions file (as a separate - package) and the software itself (including the actions file) available for - download.

If you wish to receive an email notification whenever we release updates of - Privoxy or the actions file, subscribe - to our announce mailing list, ijbswa-announce@lists.sourceforge.net.

In order not to lose your personal changes and adjustments when updating - to the latest default.action file we strongly - recommend that you use user.action and - user.filter for your local - customizations of Privoxy. See the Chapter on actions files for details.


PrevHomeNext
Introduction What's New in this Release
\ No newline at end of file + make -s install # (to really install, -s to silence output) +
+
+ +

Using GNU make, you can have the first four + steps automatically done for you by just typing:

+ + + + + +
+
+  make
+
+
+ +

in the freshly downloaded or unpacked source directory.

+ +

To build an executable with security enhanced features so that users + cannot easily bypass the proxy (e.g. "Go There + Anyway"), or alter their own configurations, configure like this:

+ + + + + +
+
+ ./configure  --disable-toggle  --disable-editor  --disable-force
+
+
+ +

Then build as above. In Privoxy 3.0.7 and later, all of these + options can also be disabled through the configuration file.

+ +

WARNING: If installing as + root, the install will fail unless a non-root user or group is + specified, or a privoxy user and group already + exist on the system. If a non-root user is specified, and no group, + then the installation will try to also use a group of the same name as + "user". If a group is specified (and no + user), then the support files will be installed as writable by that + group, and owned by the user running the installation.

+ +

configure accepts --with-user and --with-group + options for setting user and group ownership of the configuration files + (which need to be writable by the daemon). The specified user must already exist. When starting + Privoxy, it must be run as this same + user to insure write access to configuration and log files!

+ +

Alternately, you can specify user and + group on the make + command line, but be sure both already exist:

+ + + + + +
+
+ make -s install  USER=privoxy GROUP=privoxy
+
+
+ +

The default installation path for make + install is /usr/local. This may of course + be customized with the various ./configure path + options. If you are doing an install to anywhere besides /usr/local, be sure to set the appropriate paths with + the correct configure options (./configure + --help). Non-privileged users must of course have write access + permissions to wherever the target installation is going.

+ +

If you do install to /usr/local, the + install will use sysconfdir=$prefix/etc/privoxy by default. All other + destinations, and the direct usage of --sysconfdir flag behave like normal, i.e. will not add + the extra privoxy directory. This is for a + safer install, as there may already exist another program that uses a + file with the "config" name, and thus makes + /usr/local/etc cleaner.

+ +

If installing to /usr/local, the + documentation will go by default to $prefix/share/doc. But if this directory doesn't exist, + it will then try $prefix/doc and install + there before creating a new $prefix/share/doc + just for Privoxy.

+ +

Again, if the installs goes to /usr/local, + the localstatedir (ie: var/) will default to /var + instead of $prefix/var so the logs will go to + /var/log/privoxy/, and the pid file will be + created in /var/run/privoxy.pid.

+ +

make install will attempt to set the correct + values in config (main configuration file). + You should check this to make sure all values are correct. If + appropriate, an init script will be installed, but it is up to the user + to determine how and where to start Privoxy. The init script should be checked for + correct paths and values, if anything other than a default install is + done.

+ +

If install finds previous versions of local configuration files, + most of these will not be overwritten, and the new ones will be + installed with a "new" extension. + default.action and default.filter will be overwritten. You will then need + to manually update the other installed configuration files as needed. + The default template files will be overwritten. If you have + customized, local templates, these should be stored safely in a + separate directory and defined in config by + the "templdir" directive. It is of course + wise to always back-up any important configuration files "just in case". If a previous version of Privoxy is already running, you will have to + restart it manually.

+ +

For more detailed instructions on how to build Redhat RPMs, Windows + self-extracting installers, building on platforms with special + requirements etc, please consult the developer manual.

+
+ +
+

2.3. Keeping your Installation + Up-to-Date

+ +

As user feedback comes in and development continues, we will make + updated versions of both the main actions + file (as a separate package) and the software itself (including + the actions file) available for download.

+ +

If you wish to receive an email notification whenever we release + updates of Privoxy or the actions + file, subscribe to our announce mailing list, + ijbswa-announce@lists.sourceforge.net.

+ +

In order not to lose your personal changes and adjustments when + updating to the latest default.action file we + strongly recommend that you + use user.action and user.filter for your local customizations of + Privoxy. See the Chapter on actions files for details.

+
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/introduction.html privoxy-3.0.19/doc/webserver/user-manual/introduction.html --- privoxy-3.0.17/doc/webserver/user-manual/introduction.html 2010-11-13 12:51:20.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/introduction.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,282 +1,182 @@ - -Introduction - -
Privoxy 3.0.17 User Manual
PrevNext

1. Introduction

This documentation is included with the current stable version of - Privoxy, v.3.0.17.

1.1. Features

In addition to the core - features of ad blocking and - cookie management, - Privoxy provides many supplemental - features, - that give the end-user more control, more privacy and more freedom:

  • Supports "Connection: keep-alive". Outgoing connections can - be kept alive independently from the client. -

  • Supports IPv6, provided the operating system does so too, - and the configure script detects it. -

  • Supports tagging which allows to change the behaviour - based on client and server headers. -

  • Can be run as an "intercepting" proxy, which obviates the need to - configure browsers individually. -

  • Sophisticated actions and filters for manipulating both server and client - headers. -

  • Can be chained with other proxies. -

  • Integrated browser-based configuration and control utility at http://config.privoxy.org/ - (shortcut: http://p.p/). Browser-based - tracing of rule and filter effects. Remote toggling. -

  • Web page filtering (text replacements, removes banners based on size, - invisible "web-bugs" and HTML annoyances, etc.) -

  • Modularized configuration that allows for standard settings and - user settings to reside in separate files, so that installing updated - actions files won't overwrite individual user settings. -

  • Support for Perl Compatible Regular Expressions in the configuration files, and - a more sophisticated and flexible configuration syntax. -

  • GIF de-animation. -

  • Bypass many click-tracking scripts (avoids script redirection). -

  • User-customizable HTML templates for most proxy-generated pages (e.g. "blocked" page). -

  • Auto-detection and re-reading of config file changes. -

  • Most features are controllable on a per-site or per-location basis. -

  • Many smaller new features added, limitations and bugs removed. -


PrevHomeNext
Privoxy 3.0.17 User Manual Installation
\ No newline at end of file + + + + + + + Introduction + + + + + + + + + + + + + +
+

1. + Introduction

+ +

This documentation is included with the current stable version of + Privoxy, v.3.0.19.

+ +
+

1.1. + Features

+ +

In addition to the core features of ad blocking and cookie + management, Privoxy provides many + supplemental features, that give the end-user more control, more + privacy and more freedom:

+ +
    +
  • +

    Supports "Connection: keep-alive". Outgoing connections can be + kept alive independently from the client.

    +
  • + +
  • +

    Supports IPv6, provided the operating system does so too, and + the configure script detects it.

    +
  • + +
  • +

    Supports tagging which allows to change the behaviour based on + client and server headers.

    +
  • + +
  • +

    Can be run as an "intercepting" proxy, which obviates the need + to configure browsers individually.

    +
  • + +
  • +

    Sophisticated actions and filters for manipulating both server + and client headers.

    +
  • + +
  • +

    Can be chained with other proxies.

    +
  • + +
  • +

    Integrated browser-based configuration and control utility at + http://config.privoxy.org/ (shortcut: http://p.p/). Browser-based tracing + of rule and filter effects. Remote toggling.

    +
  • + +
  • +

    Web page filtering (text replacements, removes banners based on + size, invisible "web-bugs" and HTML + annoyances, etc.)

    +
  • + +
  • +

    Modularized configuration that allows for standard settings and + user settings to reside in separate files, so that installing + updated actions files won't overwrite individual user settings.

    +
  • + +
  • +

    Support for Perl Compatible Regular Expressions in the + configuration files, and a more sophisticated and flexible + configuration syntax.

    +
  • + +
  • +

    GIF de-animation.

    +
  • + +
  • +

    Bypass many click-tracking scripts (avoids script + redirection).

    +
  • + +
  • +

    User-customizable HTML templates for most proxy-generated pages + (e.g. "blocked" page).

    +
  • + +
  • +

    Auto-detection and re-reading of config file changes.

    +
  • + +
  • +

    Most features are controllable on a per-site or per-location + basis.

    +
  • + +
  • +

    Many smaller new features added, limitations and bugs + removed.

    +
  • +
+
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/quickstart.html privoxy-3.0.19/doc/webserver/user-manual/quickstart.html --- privoxy-3.0.17/doc/webserver/user-manual/quickstart.html 2010-11-13 12:51:20.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/quickstart.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,943 +1,451 @@ - -Quickstart to Using Privoxy - -
Privoxy 3.0.17 User Manual
PrevNext

4. Quickstart to Using Privoxy

  • Install Privoxy. See the Installation Section below for platform specific - information. -

  • Advanced users and those who want to offer Privoxy - service to more than just their local machine should check the main config file, especially the security-relevant options. These are - off by default. -

  • Start Privoxy, if the installation program has - not done this already (may vary according to platform). See the section - Starting Privoxy. -

  • Set your browser to use Privoxy as HTTP and - HTTPS (SSL) proxy - by setting the proxy configuration for address of - 127.0.0.1 and port 8118. - DO NOT activate proxying for FTP or - any protocols besides HTTP and HTTPS (SSL) unless you intend to prevent your - browser from using these protocols. -

  • Flush your browser's disk and memory caches, to remove any cached ad images. - If using Privoxy to manage - cookies, - you should remove any currently stored cookies too. -

  • A default installation should provide a reasonable starting point for - most. There will undoubtedly be occasions where you will want to adjust the - configuration, but that can be dealt with as the need arises. Little - to no initial configuration is required in most cases, you may want - to enable the - web-based action editor though. - Be sure to read the warnings first. -

    See the Configuration section for more - configuration options, and how to customize your installation. - You might also want to look at the next section for a quick - introduction to how Privoxy blocks ads and - banners.

  • If you experience ads that slip through, innocent images that are - blocked, or otherwise feel the need to fine-tune - Privoxy's behavior, take a look at the actions files. As a quick start, you might - find the richly commented examples - helpful. You can also view and edit the actions files through the web-based user interface. The - Appendix "Troubleshooting: Anatomy of an - Action" has hints on how to understand and debug actions that - "misbehave". -

  • Please see the section Contacting the - Developers on how to report bugs, problems with websites or to get - help. -

  • Now enjoy surfing with enhanced control, comfort and privacy! -

4.1. Quickstart to Ad Blocking

Ad blocking is but one of Privoxy's - array of features. Many of these features are for the technically minded advanced - user. But, ad and banner blocking is surely common ground for everybody.

- This section will provide a quick summary of ad blocking so - you can get up to speed quickly without having to read the more extensive - information provided below, though this is highly recommended.

First a bit of a warning ... blocking ads is much like blocking SPAM: the - more aggressive you are about it, the more likely you are to block - things that were not intended. And the more likely that some things - may not work as intended. So there is a trade off here. If you want - extreme ad free browsing, be prepared to deal with more - "problem" sites, and to spend more time adjusting the - configuration to solve these unintended consequences. In short, there is - not an easy way to eliminate all ads. Either take - the easy way and settle for most ads blocked with the - default configuration, or jump in and tweak it for your personal surfing - habits and preferences.

Secondly, a brief explanation of Privoxy's - "actions". "Actions" in this context, are - the directives we use to tell Privoxy to perform - some task relating to HTTP transactions (i.e. web browsing). We tell - Privoxy to take some "action". Each - action has a unique name and function. While there are many potential - actions in Privoxy's - arsenal, only a few are used for ad blocking. Actions, and action - configuration files, are explained in depth below.

Actions are specified in Privoxy's configuration, - followed by one or more URLs to which the action should apply. URLs - can actually be URL type patterns that use - wildcards so they can apply potentially to a range of similar URLs. The - actions, together with the URL patterns are called a section.

When you connect to a website, the full URL will either match one or more - of the sections as defined in Privoxy's configuration, - or not. If so, then Privoxy will perform the - respective actions. If not, then nothing special happens. Furthermore, web - pages may contain embedded, secondary URLs that your web browser will - use to load additional components of the page, as it parses the - original page's HTML content. An ad image for instance, is just an URL - embedded in the page somewhere. The image itself may be on the same server, - or a server somewhere else on the Internet. Complex web pages will have many - such embedded URLs. Privoxy can deal with each URL individually, so, for - instance, the main page text is not touched, but images from such-and-such - server are blocked.

The most important actions for basic ad blocking are: block, handle-as-image, - handle-as-empty-document,and - set-image-blocker:

  • block - this is perhaps - the single most used action, and is particularly important for ad blocking. - This action stops any contact between your browser and any URL patterns - that match this action's configuration. It can be used for blocking ads, - but also anything that is determined to be unwanted. By itself, it simply - stops any communication with the remote server and sends - Privoxy's own built-in BLOCKED page instead to - let you now what has happened (with some exceptions, see below). -

  • handle-as-image - - tells Privoxy to treat this URL as an image. - Privoxy's default configuration already does this - for all common image types (e.g. GIF), but there are many situations where this - is not so easy to determine. So we'll force it in these cases. This is particularly - important for ad blocking, since only if we know that it's an image of - some kind, can we replace it with an image of our choosing, instead of the - Privoxy BLOCKED page (which would only result in - a "broken image" icon). There are some limitations to this - though. For instance, you can't just brute-force an image substitution for - an entire HTML page in most situations. -

  • handle-as-empty-document - - sends an empty document instead of Privoxy's - normal BLOCKED HTML page. This is useful for file types that are neither - HTML nor images, such as blocking JavaScript files. -

  • set-image-blocker - tells - Privoxy what to display in place of an ad image that - has hit a block rule. For this to come into play, the URL must match a - block action somewhere in the - configuration, and, it must also match an - handle-as-image action. -

    The configuration options on what to display instead of the ad are: -

       pattern - a checkerboard pattern, so that an ad - replacement is obvious. This is the default. -

       blank - A very small empty GIF image is displayed. - This is the so-called "invisible" configuration option. -

       http://<URL> - A redirect to any image anywhere - of the user's choosing (advanced usage). -

Advanced users will eventually want to explore Privoxy - filters as well. Filters - are very different from blocks. - A "block" blocks a site, page, or unwanted contented. Filters - are a way of filtering or modifying what is actually on the page. An example - filter usage: a text replacement of "no-no" for - "nasty-word". That is a very simple example. This process can be - used for ad blocking, but it is more in the realm of advanced usage and has - some pitfalls to be wary off.

The quickest way to adjust any of these settings is with your browser through - the special Privoxy editor at http://config.privoxy.org/show-status - (shortcut: http://p.p/show-status). This - is an internal page, and does not require Internet access.

Note that as of Privoxy 3.0.7 beta the - action editor is disabled by default. Check the - enable-edit-actions - section in the configuration file to learn why and in which - cases it's safe to enable again.

If you decided to enable the action editor, select the appropriate - "actions" file, and click - "Edit". It is best to put personal or - local preferences in user.action since this is not - meant to be overwritten during upgrades, and will over-ride the settings in - other files. Here you can insert new "actions", and URLs for ad - blocking or other purposes, and make other adjustments to the configuration. - Privoxy will detect these changes automatically.

A quick and simple step by step example:

  • Right click on the ad image to be blocked, then select - "Copy Link Location" from the - pop-up menu. -

  • Set your browser to - http://config.privoxy.org/show-status -

  • Find user.action in the top section, and click - on "Edit": -

    Figure 1. Actions Files in Use

    -

  • You should have a section with only - block listed under - "Actions:". - If not, click a "Insert new section below" - button, and in the new section that just appeared, click the - Edit button right under the word "Actions:". - This will bring up a list of all actions. Find - block near the top, and click - in the "Enabled" column, then "Submit" - just below the list. -

  • Now, in the block actions section, - click the "Add" button, and paste the URL the - browser got from "Copy Link Location". - Remove the http:// at the beginning of the URL. Then, click - "Submit" (or - "OK" if in a pop-up window). -

  • Now go back to the original page, and press SHIFT-Reload - (or flush all browser caches). The image should be gone now. -

This is a very crude and simple example. There might be good reasons to use a - wildcard pattern match to include potentially similar images from the same - site. For a more extensive explanation of "patterns", and - the entire actions concept, see the Actions - section.

For advanced users who want to hand edit their config files, you might want - to now go to the Actions Files Tutorial. - The ideas explained therein also apply to the web-based editor.

There are also various - filters that can be used for ad blocking - (filters are a special subset of actions). These - fall into the "advanced" usage category, and are explained in - depth in later sections.


PrevHomeNext
What's New in this Release Starting Privoxy
\ No newline at end of file + + + + + + + Quickstart to Using Privoxy + + + + + + + + + + + + + +
+

4. Quickstart to + Using Privoxy

+ +
    +
  • +

    Install Privoxy. See the Installation Section below for platform + specific information.

    +
  • + +
  • +

    Advanced users and those who want to offer Privoxy service to more than just their local + machine should check the main config file, + especially the security-relevant options. These are + off by default.

    +
  • + +
  • +

    Start Privoxy, if the + installation program has not done this already (may vary according to + platform). See the section Starting + Privoxy.

    +
  • + +
  • +

    Set your browser to use Privoxy + as HTTP and HTTPS (SSL) proxy + by setting the proxy configuration for address of 127.0.0.1 and port 8118. + DO NOT activate proxying + for FTP or any protocols besides HTTP and + HTTPS (SSL) unless you intend to prevent your browser from using + these protocols.

    +
  • + +
  • +

    Flush your browser's disk and memory caches, to remove any cached + ad images. If using Privoxy to + manage cookies, you should remove any currently stored cookies + too.

    +
  • + +
  • +

    A default installation should provide a reasonable starting point + for most. There will undoubtedly be occasions where you will want to + adjust the configuration, but that can be dealt with as the need + arises. Little to no initial configuration is required in most cases, + you may want to enable the web-based action editor though. Be sure to read the + warnings first.

    + +

    See the Configuration section for + more configuration options, and how to customize your installation. + You might also want to look at the next section for a quick + introduction to how Privoxy blocks + ads and banners.

    +
  • + +
  • +

    If you experience ads that slip through, innocent images that are + blocked, or otherwise feel the need to fine-tune Privoxy's behavior, take a look at the actions files. As a quick start, you might + find the richly commented + examples helpful. You can also view and edit the actions files + through the web-based user interface. The Appendix "Troubleshooting: Anatomy + of an Action" has hints on how to understand and debug + actions that "misbehave".

    +
  • + +
  • +

    Please see the section Contacting the + Developers on how to report bugs, problems with websites or to + get help.

    +
  • + +
  • +

    Now enjoy surfing with enhanced control, comfort and privacy!

    +
  • +
+ +
+

4.1. Quickstart to Ad Blocking

+ +

Ad blocking is but one of Privoxy's + array of features. Many of these features are for the technically + minded advanced user. But, ad and banner blocking is surely common + ground for everybody.

+ +

This section will provide a quick summary of ad blocking so you can + get up to speed quickly without having to read the more extensive + information provided below, though this is highly recommended.

+ +

First a bit of a warning ... blocking ads is much like blocking + SPAM: the more aggressive you are about it, the more likely you are to + block things that were not intended. And the more likely that some + things may not work as intended. So there is a trade off here. If you + want extreme ad free browsing, be prepared to deal with more + "problem" sites, and to spend more time + adjusting the configuration to solve these unintended consequences. In + short, there is not an easy way to eliminate all ads. Either take the easy way and + settle for most ads blocked + with the default configuration, or jump in and tweak it for your + personal surfing habits and preferences.

+ +

Secondly, a brief explanation of Privoxy's "actions". + "Actions" in this context, are the + directives we use to tell Privoxy to + perform some task relating to HTTP transactions (i.e. web browsing). We + tell Privoxy to take some "action". Each action has a unique name and function. + While there are many potential actions + in Privoxy's arsenal, only a few are + used for ad blocking. Actions, + and action configuration files, are + explained in depth below.

+ +

Actions are specified in Privoxy's + configuration, followed by one or more URLs to which the action should + apply. URLs can actually be URL type patterns that use wildcards so they + can apply potentially to a range of similar URLs. The actions, together + with the URL patterns are called a section.

+ +

When you connect to a website, the full URL will either match one or + more of the sections as defined in Privoxy's configuration, or not. If so, then + Privoxy will perform the respective + actions. If not, then nothing special happens. Furthermore, web pages + may contain embedded, secondary URLs that your web browser will use to + load additional components of the page, as it parses the original + page's HTML content. An ad image for instance, is just an URL embedded + in the page somewhere. The image itself may be on the same server, or a + server somewhere else on the Internet. Complex web pages will have many + such embedded URLs. Privoxy can deal + with each URL individually, so, for instance, the main page text is not + touched, but images from such-and-such server are blocked.

+ +

The most important actions for basic ad blocking are: block, handle-as-image, + handle-as-empty-document,and + set-image-blocker:

+ +
    +
  • +

    block - this is perhaps the + single most used action, and is particularly important for ad + blocking. This action stops any contact between your browser and + any URL patterns that match this action's configuration. It can be + used for blocking ads, but also anything that is determined to be + unwanted. By itself, it simply stops any communication with the + remote server and sends Privoxy's + own built-in BLOCKED page instead to let you now what has happened + (with some exceptions, see below).

    +
  • + +
  • +

    handle-as-image - + tells Privoxy to treat this URL as + an image. Privoxy's default + configuration already does this for all common image types (e.g. + GIF), but there are many situations where this is not so easy to + determine. So we'll force it in these cases. This is particularly + important for ad blocking, since only if we know that it's an image + of some kind, can we replace it with an image of our choosing, + instead of the Privoxy BLOCKED + page (which would only result in a "broken + image" icon). There are some limitations to this though. For + instance, you can't just brute-force an image substitution for an + entire HTML page in most situations.

    +
  • + +
  • +

    handle-as-empty-document + - sends an empty document instead of Privoxy's normal BLOCKED HTML page. This is + useful for file types that are neither HTML nor images, such as + blocking JavaScript files.

    +
  • + +
  • +

    set-image-blocker - + tells Privoxy what to display in + place of an ad image that has hit a block rule. For this to come + into play, the URL must match a block action somewhere in the + configuration, and, it + must also match an handle-as-image + action.

    + +

    The configuration options on what to display instead of the ad + are:

    + + + + + + + +
       pattern - a checkerboard + pattern, so that an ad replacement is obvious. This is the + default.
    + + + + + + + +
       blank - A very small empty GIF + image is displayed. This is the so-called "invisible" configuration option.
    + + + + + + + +
       http://<URL> - A redirect + to any image anywhere of the user's choosing (advanced + usage).
    +
  • +
+ +

Advanced users will eventually want to explore Privoxy filters as well. Filters are very + different from blocks. A "block" blocks a site, page, or unwanted contented. + Filters are a way of filtering or modifying what is actually on the + page. An example filter usage: a text replacement of "no-no" for "nasty-word". + That is a very simple example. This process can be used for ad + blocking, but it is more in the realm of advanced usage and has some + pitfalls to be wary off.

+ +

The quickest way to adjust any of these settings is with your + browser through the special Privoxy + editor at http://config.privoxy.org/show-status (shortcut: http://p.p/show-status). This is an + internal page, and does not require Internet access.

+ +

Note that as of Privoxy 3.0.7 beta + the action editor is disabled by default. Check the enable-edit-actions + section in the configuration file to learn why and in which cases + it's safe to enable again.

+ +

If you decided to enable the action editor, select the appropriate + "actions" file, and click "Edit". It is best to put + personal or local preferences in user.action + since this is not meant to be overwritten during upgrades, and will + over-ride the settings in other files. Here you can insert new + "actions", and URLs for ad blocking or other + purposes, and make other adjustments to the configuration. Privoxy will detect these changes + automatically.

+ +

A quick and simple step by step example:

+ +
    +
  • +

    Right click on the ad image to be blocked, then select + "Copy Link + Location" from the pop-up menu.

    +
  • + +
  • +

    Set your browser to http://config.privoxy.org/show-status

    +
  • + +
  • +

    Find user.action in the top section, + and click on "Edit":

    + +
    + + +

    Figure 1. Actions Files in Use

    + +
    +

    +
    +
    +
  • + +
  • +

    You should have a section with only block listed under "Actions:". If not, click a "Insert new section + below" button, and in the new section that just + appeared, click the Edit button + right under the word "Actions:". This + will bring up a list of all actions. Find block near the + top, and click in the "Enabled" column, + then "Submit" just below the list.

    +
  • + +
  • +

    Now, in the block actions section, click the + "Add" + button, and paste the URL the browser got from "Copy Link + Location". Remove the http:// at the beginning of the URL. Then, click + "Submit" + (or "OK" + if in a pop-up window).

    +
  • + +
  • +

    Now go back to the original page, and press SHIFT-Reload (or flush all browser caches). The image + should be gone now.

    +
  • +
+ +

This is a very crude and simple example. There might be good reasons + to use a wildcard pattern match to include potentially similar images + from the same site. For a more extensive explanation of "patterns", and the entire actions concept, see the Actions section.

+ +

For advanced users who want to hand edit their config files, you + might want to now go to the Actions Files Tutorial. The ideas + explained therein also apply to the web-based editor.

+ +

There are also various filters that can be used for ad blocking + (filters are a special subset of actions). These fall into the + "advanced" usage category, and are explained + in depth in later sections.

+
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/seealso.html privoxy-3.0.19/doc/webserver/user-manual/seealso.html --- privoxy-3.0.17/doc/webserver/user-manual/seealso.html 2010-11-13 12:51:20.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/seealso.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,418 +1,208 @@ - -See Also - -
Privoxy 3.0.17 User Manual
PrevNext

13. See Also

Other references and sites of interest to Privoxy - users:

http://www.privoxy.org/, - the Privoxy Home page. -

-

http://www.privoxy.org/faq/, - the Privoxy FAQ. -

-

http://www.privoxy.org/developer-manual/, - the Privoxy developer manual. -

-

https://sourceforge.net/projects/ijbswa/, - the Project Page for Privoxy on - SourceForge. -

-

http://config.privoxy.org/, - the web-based user interface. Privoxy must be - running for this to work. Shortcut: http://p.p/ -

-

https://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit "misses" and other - configuration related suggestions to the developers. -

- - -

http://www.junkbusters.com/ht/en/cookies.html, - an explanation how cookies are used to track web users. -

-

http://www.junkbusters.com/ijb.html, - the original Internet Junkbuster. -

-

http://www.squid-cache.org/, a popular - caching proxy, which is often used together with Privoxy. -

-

http://www.pps.jussieu.fr/~jch/software/polipo/, - Polipo is a caching proxy with advanced features - like pipelining, multiplexing and caching of partial instances. In many setups - it can be used as Squid replacement. -

-

https://www.torproject.org/, - Tor can help anonymize web browsing, - web publishing, instant messaging, IRC, SSH, and other applications. -

-


PrevHomeNext
Privoxy Copyright, License and History Appendix
\ No newline at end of file + + + + + + + See Also + + + + + + + + + + + + + +
+

13. See Also

+ +

Other references and sites of interest to Privoxy users:

+ + + + + + + +
http://www.privoxy.org/, the Privoxy Home page.
+ + + + + + + +
http://www.privoxy.org/faq/, the Privoxy FAQ.
+ + + + + + + +
http://www.privoxy.org/developer-manual/, the + Privoxy developer manual.
+ + + + + + + +
https://sourceforge.net/projects/ijbswa/, the Project + Page for Privoxy on SourceForge.
+ + + + + + + +
http://config.privoxy.org/, the web-based user + interface. Privoxy must be running + for this to work. Shortcut: http://p.p/
+ + + + + + + +
https://sourceforge.net/tracker/?group_id=11118&atid=460288, + to submit "misses" and other + configuration related suggestions to the developers.
+ + + + + + + +
http://www.junkbusters.com/ht/en/cookies.html, an + explanation how cookies are used to track web users.
+ + + + + + + +
http://www.junkbusters.com/ijb.html, the original + Internet Junkbuster.
+ + + + + + + +
http://www.squid-cache.org/, a popular caching proxy, + which is often used together with Privoxy.
+ + + + + + + +
http://www.pps.jussieu.fr/~jch/software/polipo/, + Polipo is a caching proxy with + advanced features like pipelining, multiplexing and caching of + partial instances. In many setups it can be used as Squid replacement.
+ + + + + + + +
https://www.torproject.org/, Tor can help anonymize web browsing, web + publishing, instant messaging, IRC, SSH, and other + applications.
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/startup.html privoxy-3.0.19/doc/webserver/user-manual/startup.html --- privoxy-3.0.17/doc/webserver/user-manual/startup.html 2010-11-13 12:51:20.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/startup.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,902 +1,458 @@ - -Starting Privoxy - -
Privoxy 3.0.17 User Manual
PrevNext

5. Starting Privoxy

Before launching Privoxy for the first time, you - will want to configure your browser(s) to use - Privoxy as a HTTP and HTTPS (SSL) - proxy. The default is - 127.0.0.1 (or localhost) for the proxy address, and port 8118 (earlier versions - used port 8000). This is the one configuration step that must be done!

Please note that Privoxy can only proxy HTTP and - HTTPS traffic. It will not work with FTP or other protocols.

Figure 2. Proxy Configuration Showing - Mozilla/Netscape HTTP and HTTPS (SSL) Settings

-

- With Firefox, this is typically set under:

 Tools -> Options ->  Advanced -> Network ->Connection -> Settings

- Or optionally on some platforms:

 Edit -> Preferences -> General -> Connection Settings -> Manual Proxy Configuration

- With Netscape (and - Mozilla), this can be set under:

 Edit -> Preferences -> Advanced -> Proxies -> HTTP Proxy

For Internet Explorer v.5-7:

 Tools -> Internet Options -> Connections -> LAN Settings

Then, check "Use Proxy" and fill in the appropriate info - (Address: 127.0.0.1, Port: 8118). Include HTTPS (SSL), if you want HTTPS - proxy support too (sometimes labeled "Secure"). Make sure any - checkboxes like "Use the same proxy server for all protocols" is - UNCHECKED. You want only HTTP and HTTPS (SSL)!

Figure 3. Proxy Configuration Showing - Internet Explorer HTTP and HTTPS (Secure) Settings

-

After doing this, flush your browser's disk and memory caches to force a - re-reading of all pages and to get rid of any ads that may be cached. Remove - any cookies, - if you want Privoxy to manage that. You are now - ready to start enjoying the benefits of using - Privoxy!

Privoxy itself is typically started by specifying the - main configuration file to be used on the command line. If no configuration - file is specified on the command line, Privoxy - will look for a file named config in the current - directory. Except on Win32 where it will try config.txt.

5.1. Red Hat and Fedora

A default Red Hat installation may not start Privoxy upon boot. It will use - the file /etc/privoxy/config as its main configuration - file.

 # /etc/rc.d/init.d/privoxy start

Or ...

 # service privoxy start

5.2. Debian

We use a script. Note that Debian typically starts Privoxy upon booting per - default. It will use the file - /etc/privoxy/config as its main configuration - file.

 # /etc/init.d/privoxy start

5.3. Windows

Click on the Privoxy Icon to start Privoxy. If no configuration file is - specified on the command line, Privoxy will look - for a file named config.txt. Note that Windows will - automatically start Privoxy when the system starts if you chose that option - when installing.

Privoxy can run with full Windows service functionality. - On Windows only, the Privoxy program has two new command line arguments - to install and uninstall Privoxy as a service. See the - Windows Installation - instructions for details.

5.4. Solaris, NetBSD, FreeBSD, HP-UX and others

Example Unix startup command:

 # /usr/sbin/privoxy /etc/privoxy/config

5.5. OS/2

During installation, Privoxy is configured to - start automatically when the system restarts. You can start it manually by - double-clicking on the Privoxy icon in the - Privoxy folder.

5.6. Mac OS X

After downloading the privoxy software, unzip the downloaded file by - double-clicking on the zip file icon. Then, double-click on the - installer package icon and follow the installation process.

The privoxy service will automatically start after a successful - installation. In addition, the privoxy service will automatically - start every time your computer starts up.

To prevent the privoxy service from automatically starting when your - computer starts up, remove or rename the folder named - /Library/StartupItems/Privoxy.

A simple application named Privoxy Utility has been created which - enables administrators to easily start and stop the privoxy service.

In addition, the Privoxy Utility presents a simple way for - administrators to edit the various privoxy config files. A method - to uninstall the software is also available.

An administrator username and password must be supplied in order for - the Privoxy Utility to perform any of the tasks.

5.7. AmigaOS

Start Privoxy (with RUN <>NIL:) in your - startnet script (AmiTCP), in - s:user-startup (RoadShow), as startup program in your - startup script (Genesis), or as startup action (Miami and MiamiDx). - Privoxy will automatically quit when you quit your - TCP/IP stack (just ignore the harmless warning your TCP/IP stack may display that - Privoxy is still running).

5.8. Gentoo

A script is again used. It will use the file /etc/privoxy/config - as its main configuration file.

 /etc/init.d/privoxy start
- 

Note that Privoxy is not automatically started at - boot time by default. You can change this with the rc-update - command.

-
 rc-update add privoxy default
- 

5.9. Command Line Options

Privoxy may be invoked with the following - command-line options:

  • --version -

    Print version info and exit. Unix only. -

  • --help -

    Print short usage info and exit. Unix only. -

  • --no-daemon -

    Don't become a daemon, i.e. don't fork and become process group - leader, and don't detach from controlling tty. Unix only. -

  • --pidfile FILE -

    On startup, write the process ID to FILE. Delete the - FILE on exit. Failure to create or delete the - FILE is non-fatal. If no FILE - option is given, no PID file will be used. Unix only. -

  • --user USER[.GROUP] -

    After (optionally) writing the PID file, assume the user ID of - USER, and if included the GID of GROUP. Exit if the - privileges are not sufficient to do so. Unix only. -

  • --chroot -

    Before changing to the user ID given in the --user option, - chroot to that user's home directory, i.e. make the kernel pretend to the Privoxy - process that the directory tree starts there. If set up carefully, this can limit - the impact of possible vulnerabilities in Privoxy to the files contained in that hierarchy. - Unix only. -

  • --pre-chroot-nslookup hostname -

    Specifies a hostname to look up before doing a chroot. On some systems, initializing the - resolver library involves reading config files from /etc and/or loading additional shared - libraries from /lib. On these systems, doing a hostname lookup before the chroot reduces - the number of files that must be copied into the chroot tree. -

    For fastest startup speed, a good value is a hostname that is not in /etc/hosts but that - your local name server (listed in /etc/resolv.conf) can resolve without recursion - (that is, without having to ask any other name servers). The hostname need not exist, - but if it doesn't, an error message (which can be ignored) will be output. -

  • configfile -

    If no configfile is included on the command line, - Privoxy will look for a file named - "config" in the current directory (except on Win32 - where it will look for "config.txt" instead). Specify - full path to avoid confusion. If no config file is found, - Privoxy will fail to start. -

On MS Windows only there are two additional - command-line options to allow Privoxy to install and - run as a service. See the -Window Installation section -for details.


PrevHomeNext
Quickstart to Using Privoxy Privoxy Configuration
\ No newline at end of file + + + + + + + Starting Privoxy + + + + + + + + + + + + + +
+

5. Starting + Privoxy

+ +

Before launching Privoxy for the + first time, you will want to configure your browser(s) to use + Privoxy as a HTTP and HTTPS (SSL) + proxy. The default is 127.0.0.1 (or localhost) for the proxy + address, and port 8118 (earlier versions used port 8000). This is the one + configuration step that must be + done!

+ +

Please note that Privoxy can only + proxy HTTP and HTTPS traffic. It will not work with FTP or other + protocols.

+ +
+ + +

Figure 2. Proxy Configuration Showing Mozilla/Netscape + HTTP and HTTPS (SSL) Settings

+ +
+

+
+
+ +

With Firefox, this is typically set + under:

+ +

 Tools -> Options ->  Advanced -> Network ->Connection -> Settings

+ +

Or optionally on some platforms:

+ +

 Edit -> Preferences -> General -> Connection Settings -> Manual Proxy Configuration

+ +

With Netscape (and Mozilla), this can be set under:

+ +

 Edit -> Preferences -> Advanced -> Proxies -> HTTP + Proxy

+ +

For Internet Explorer v.5-7:

+ +

 Tools -> Internet + Options -> Connections -> LAN Settings

+ +

Then, check "Use Proxy" and fill in the + appropriate info (Address: 127.0.0.1, Port: 8118). Include HTTPS (SSL), + if you want HTTPS proxy support too (sometimes labeled "Secure"). Make sure any checkboxes like "Use the same proxy server for all protocols" is + UNCHECKED. You want only HTTP + and HTTPS (SSL)!

+ +
+ + +

Figure 3. Proxy Configuration Showing Internet Explorer + HTTP and HTTPS (Secure) Settings

+ +
+

+
+
+ +

After doing this, flush your browser's disk and memory caches to force + a re-reading of all pages and to get rid of any ads that may be cached. + Remove any cookies, if you want Privoxy + to manage that. You are now ready to start enjoying the benefits of using + Privoxy!

+ +

Privoxy itself is typically started + by specifying the main configuration file to be used on the command line. + If no configuration file is specified on the command line, Privoxy will look for a file named config in the current directory. Except on Win32 where it + will try config.txt.

+ +
+

5.1. Red Hat + and Fedora

+ +

A default Red Hat installation may not start Privoxy upon boot. It will use the file /etc/privoxy/config as its main configuration file.

+ + + + + +
+
+ # /etc/rc.d/init.d/privoxy start
+
+
+ +

Or ...

+ + + + + +
+
+ # service privoxy start
+
+
+
+ +
+

5.2. + Debian

+ +

We use a script. Note that Debian typically starts Privoxy upon booting per default. It will use the + file /etc/privoxy/config as its main + configuration file.

+ + + + + +
+
+ # /etc/init.d/privoxy start
+
+
+
+ +
+

5.3. + Windows

+ +

Click on the Privoxy Icon to start + Privoxy. If no configuration file is + specified on the command line, Privoxy + will look for a file named config.txt. Note + that Windows will automatically start Privoxy when the system starts if you chose that + option when installing.

+ +

Privoxy can run with full Windows + service functionality. On Windows only, the Privoxy program has two new command line arguments + to install and uninstall Privoxy as a + service. See the Windows Installation + instructions for details.

+
+ +
+

5.4. + Solaris, NetBSD, FreeBSD, HP-UX and others

+ +

Example Unix startup command:

+ + + + + +
+
+ # /usr/sbin/privoxy /etc/privoxy/config
+
+
+
+ +
+

5.5. OS/2

+ +

During installation, Privoxy is + configured to start automatically when the system restarts. You can + start it manually by double-clicking on the Privoxy icon in the Privoxy folder.

+
+ +
+

5.6. Mac OS + X

+ +

After downloading the privoxy software, unzip the downloaded file by + double-clicking on the zip file icon. Then, double-click on the + installer package icon and follow the installation process.

+ +

The privoxy service will automatically start after a successful + installation. In addition, the privoxy service will automatically start + every time your computer starts up.

+ +

To prevent the privoxy service from automatically starting when your + computer starts up, remove or rename the folder named + /Library/StartupItems/Privoxy.

+ +

A simple application named Privoxy Utility has been created which + enables administrators to easily start and stop the privoxy + service.

+ +

In addition, the Privoxy Utility presents a simple way for + administrators to edit the various privoxy config files. A method to + uninstall the software is also available.

+ +

An administrator username and password must be supplied in order for + the Privoxy Utility to perform any of the tasks.

+
+ +
+

5.7. + AmigaOS

+ +

Start Privoxy (with RUN + <>NIL:) in your startnet script + (AmiTCP), in s:user-startup (RoadShow), as + startup program in your startup script (Genesis), or as startup action + (Miami and MiamiDx). Privoxy will + automatically quit when you quit your TCP/IP stack (just ignore the + harmless warning your TCP/IP stack may display that Privoxy is still running).

+
+ +
+

5.8. + Gentoo

+ +

A script is again used. It will use the file /etc/privoxy/config as its main configuration file.

+ + + + + +
+
+ /etc/init.d/privoxy start
+
+
+
+ +

Note that Privoxy is not + automatically started at boot time by default. You can change this with + the rc-update command.

+ + + + + +
+
+ rc-update add privoxy default
+
+
+
+
+ +
+

5.9. Command + Line Options

+ +

Privoxy may be invoked with the + following command-line options:

+ +
    +
  • +

    --version

    + +

    Print version info and exit. Unix only.

    +
  • + +
  • +

    --help

    + +

    Print short usage info and exit. Unix only.

    +
  • + +
  • +

    --no-daemon

    + +

    Don't become a daemon, i.e. don't fork and become process group + leader, and don't detach from controlling tty. Unix only.

    +
  • + +
  • +

    --pidfile FILE

    + +

    On startup, write the process ID to FILE. Delete the FILE on exit. Failure to create or + delete the FILE is + non-fatal. If no FILE + option is given, no PID file will be used. Unix only.

    +
  • + +
  • +

    --user + USER[.GROUP]

    + +

    After (optionally) writing the PID file, assume the user ID of + USER, and if included the + GID of GROUP. Exit if the privileges are not sufficient to do so. + Unix only.

    +
  • + +
  • +

    --chroot

    + +

    Before changing to the user ID given in the --user option, chroot to that user's + home directory, i.e. make the kernel pretend to the Privoxy process that the directory tree starts + there. If set up carefully, this can limit the impact of possible + vulnerabilities in Privoxy to the + files contained in that hierarchy. Unix only.

    +
  • + +
  • +

    --pre-chroot-nslookup + hostname

    + +

    Specifies a hostname to look up before doing a chroot. On some + systems, initializing the resolver library involves reading config + files from /etc and/or loading additional shared libraries from + /lib. On these systems, doing a hostname lookup before the chroot + reduces the number of files that must be copied into the chroot + tree.

    + +

    For fastest startup speed, a good value is a hostname that is + not in /etc/hosts but that your local name server (listed in + /etc/resolv.conf) can resolve without recursion (that is, without + having to ask any other name servers). The hostname need not exist, + but if it doesn't, an error message (which can be ignored) will be + output.

    +
  • + +
  • +

    configfile

    + +

    If no configfile is + included on the command line, Privoxy will look for a file named + "config" in the current directory + (except on Win32 where it will look for "config.txt" instead). Specify full path to avoid + confusion. If no config file is found, Privoxy will fail to start.

    +
  • +
+ +

On MS Windows only there are two + additional command-line options to allow Privoxy to install and run as a service. See the Window Installation + section for details.

+
+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/templates.html privoxy-3.0.19/doc/webserver/user-manual/templates.html --- privoxy-3.0.17/doc/webserver/user-manual/templates.html 2010-11-13 12:51:20.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/templates.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,321 +1,172 @@ - -Privoxy's Template Files - -
Privoxy 3.0.17 User Manual
PrevNext

10. Privoxy's Template Files

All Privoxy built-in pages, i.e. error pages such as the - "404 - No Such Domain" - error page, the "BLOCKED" - page - and all pages of its web-based - user interface, are generated from templates. - (Privoxy must be running for the above links to work as - intended.)

These templates are stored in a subdirectory of the configuration - directory called templates. On Unixish platforms, - this is typically - /etc/privoxy/templates/.

The templates are basically normal HTML files, but with place-holders (called symbols - or exports), which Privoxy fills at run time. It - is possible to edit the templates with a normal text editor, should you want - to customize them. (Not recommended for the casual - user). Should you create your own custom templates, you should use - the config setting templdir - to specify an alternate location, so your templates do not get overwritten - during upgrades. -

Note that just like in configuration files, lines starting - with # are ignored when the templates are filled in.

The place-holders are of the form @name@, and you will - find a list of available symbols, which vary from template to template, - in the comments at the start of each file. Note that these comments are not - always accurate, and that it's probably best to look at the existing HTML - code to find out which symbols are supported and what they are filled in with.

A special application of this substitution mechanism is to make whole - blocks of HTML code disappear when a specific symbol is set. We use this - for many purposes, one of them being to include the beta warning in all - our user interface (CGI) pages when Privoxy - is in an alpha or beta development stage:

+ +
<!-- @if-unstable-start -->
+
+
+
+
+  
+
+  Privoxy's Template Files
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+  
+
+  
+

10. Privoxy's + Template Files

+ +

All Privoxy built-in pages, i.e. + error pages such as the "404 - No Such Domain" error page, + the "BLOCKED" page and all pages + of its web-based user + interface, are generated from templates. (Privoxy must be running for the above links to work + as intended.)

+ +

These templates are stored in a subdirectory of the configuration directory called templates. On Unixish platforms, this is typically + /etc/privoxy/templates/.

+ +

The templates are basically normal HTML files, but with place-holders + (called symbols or exports), which Privoxy fills at run time. It is possible to edit + the templates with a normal text editor, should you want to customize + them. (Not recommended for the casual + user). Should you create your own custom templates, you should use + the config setting templdir to specify an alternate location, so + your templates do not get overwritten during upgrades.

+ +

Note that just like in configuration files, lines starting with + # are ignored when the templates are filled + in.

+ +

The place-holders are of the form @name@, and + you will find a list of available symbols, which vary from template to + template, in the comments at the start of each file. Note that these + comments are not always accurate, and that it's probably best to look at + the existing HTML code to find out which symbols are supported and what + they are filled in with.

+ +

A special application of this substitution mechanism is to make whole + blocks of HTML code disappear when a specific symbol is set. We use this + for many purposes, one of them being to include the beta warning in all + our user interface (CGI) pages when Privoxy is in an alpha or beta development + stage:

+ + + +
+
+<!-- @if-unstable-start -->
 
   ... beta warning HTML code goes here ...
 
-<!-- if-unstable-end@ -->

If the "unstable" symbol is set, everything in between and including - @if-unstable-start and if-unstable-end@ - will disappear, leaving nothing but an empty comment:

<!--  -->

There's also an if-then-else construct and an #include - mechanism, but you'll sure find out if you are inclined to edit the - templates ;-)

All templates refer to a style located at - http://config.privoxy.org/send-stylesheet. - This is, of course, locally served by Privoxy - and the source for it can be found and edited in the - cgi-style.css template.


PrevHomeNext
Filter Files Contacting the Developers, Bug Reporting and Feature -Requests
\ No newline at end of file +<!-- if-unstable-end@ --> +
+
+ +

If the "unstable" symbol is set, everything in between and including + @if-unstable-start and if-unstable-end@ will disappear, leaving nothing but an + empty comment:

+ + + + + +
+
+<!--  -->
+
+
+ +

There's also an if-then-else construct and an #include mechanism, but you'll sure find out if you are + inclined to edit the templates ;-)

+ +

All templates refer to a style located at http://config.privoxy.org/send-stylesheet. This is, of + course, locally served by Privoxy and + the source for it can be found and edited in the cgi-style.css template.

+
+ + + + diff -Nru privoxy-3.0.17/doc/webserver/user-manual/whatsnew.html privoxy-3.0.19/doc/webserver/user-manual/whatsnew.html --- privoxy-3.0.17/doc/webserver/user-manual/whatsnew.html 2010-11-13 20:17:17.000000000 +0000 +++ privoxy-3.0.19/doc/webserver/user-manual/whatsnew.html 2011-12-26 17:06:03.000000000 +0000 @@ -1,797 +1,1060 @@ - -What's New in this Release - -
Privoxy 3.0.17 User Manual
PrevNext

3. What's New in this Release

Privoxy 3.0.17 is a stable release. - The changes since 3.0.16 stable are:

  • Fixed last-chunk-detection for responses where the content was small - enough to be read with the body, causing Privoxy to wait for the - end of the content until the server closed the connection or the - request timed out. Reported by "Karsten" in #3028326. -

  • Responses with status code 204 weren't properly detected as body-less - like RFC2616 mandates. Like the previous bug, this caused Privoxy to - wait for the end of the content until the server closed the connection - or the request timed out. Fixes #3022042 and #3025553, reported by a - user with no visible name. Most likely also fixes a bunch of other - AJAX-related problem reports that got closed in the past due to - insufficient information and lack of feedback. -

  • Fixed an ACL bug that made it impossible to build a blacklist. - Usually the ACL directives are used in a whitelist, which worked - as expected, but blacklisting is still useful for public proxies - where one only needs to deny known abusers access. -

  • Added LOG_LEVEL_RECEIVED to log the not-yet-parsed data read from the - network. This should make debugging various parsing issues a lot easier. -

  • The IPv6 code is enabled by default on Windows versions that support it. - Patch submitted by oCameLo in #2942729. -

  • In mingw32 versions, the user.filter file is reachable through the - GUI, just like default.filter is. Feature request 3040263. -

  • Added the configure option --enable-large-file-support to set a few - defines that are required by platforms like GNU/Linux to support files - larger then 2GB. Mainly interesting for users without proper logfile - management. -

  • Logging with "debug 16" no longer stops at the first nul byte which is - pretty useless. Non-printable characters are replaced with their hex value - so the result can't span multiple lines making parsing them harder then - necessary. -

  • Privoxy logs when reading an action, filter or trust file. -

  • Fixed incorrect regression test markup which caused a test in - 3.0.16 to fail while Privoxy itself was working correctly. - While Privoxy accepts hide-referer, too, the action name is actually - hide-referrer which is also the name used one the final results page, - where the test expected the alias. -

  • CGI interface improvements: -

    • In finish_http_response(), continue to add the 'Connection: close' - header if the client connection will not be kept alive. - Anonymously pointed out in #2987454. -

    • Apostrophes in block messages no longer cause parse errors - when the blocked page is viewed with JavaScript enabled. - Reported by dg1727 in #3062296. -

    • Fix a bunch of anchors that used underscores instead of dashes. -

    • Allow to keep the client connection alive after crunching the previous request. - Already opened server connections can be kept alive, too. -

    • In cgi_show_url_info(), don't forget to prefix URLs that only contain - http:// or https:// in the path. Fixes #2975765 reported by Adam Piggott. -

    • Show the 404 CGI page if cgi_send_user_manual() is called while - local user manual delivery is disabled. -

    -

  • Action file improvements: -

    • Enable user.filter by default. Suggested by David White in #3001830. -

    • Block .sitestat.com/. Reported by johnd16 in #3002725. -

    • Block .atemda.com/. Reported by johnd16 in #3002723. -

    • Block js.adlink.net/. Reported by johnd16 in #3002720. -

    • Block .analytics.yahoo.com/. Reported by johnd16 in #3002713. -

    • Block sb.scorecardresearch.com, too. Reported by dg1727 in #2992652. -

    • Fix problems noticed on Yahoo mail and news pages. -

    • Remove the too broad yahoo section, only keeping the - fast-redirects exception as discussed on ijbswa-devel@. -

    • Don't block adesklets.sourceforge.net. Reported in #2974204. -

    • Block chartbeat ping tracking. Reported in #2975895. -

    • Tag CSS and image requests with cautious and medium settings, too. -

    • Don't handle view.atdmt.com as image. It's used for click-throughs - so users should be able to "go there anyway". - Reported by Adam Piggott in #2975927. -

    • Also let the refresh-tags filter remove invalid refresh tags where - the 'url=' part is missing. Anonymously reported in #2986382. - While at it, update the description to mention the fact that only - refresh tags with refresh times above 9 seconds are covered. -

    • javascript needs to be blocked with +handle-as-empty-document to - work around Firefox bug 492459. So move .js blockers from - +block{Might be a web-bug.} -handle-as-empty-document to - +block{Might be a web-bug.} +handle-as-empty-document. -

    • ijbswa-Feature Requests-3006719 - Block 160x578 Banners. -

    • Block another omniture tracking domain. -

    • Added a range-requests tagger. -

    • Added two sections to get Flickr's Ajax interface working with - default pre-settings. If you change the configuration to block - cookies by default, you'll need additional exceptions. - Reported by Mathias Homann in #3101419 and by Patrick on ijbswa-users@. -

    -

  • Documentation improvements: -

    • Explicitly mention how to match all URLs. -

    • Consistently recommend socks5 in the Tor FAQ entry and mention - its advantage compared to socks4a. Reported by David in #2960129. -

    • Slightly improve the explanation of why filtering may appear - slower than it is. -

    • Grammar fixes for the ACL section. -

    • Fixed a link to the 'intercepting' entry and add another one. -

    • Rename the 'Other' section to 'Mailing Lists' and reword it - to make it clear that nobody is forced to use the trackers -

    • Note that 'anonymously' posting on the trackers may not always - be possible. -

    • Suggest to enable debug 32768 when suspecting parsing problems. -

    -

  • Privoxy-Log-Parser improvements: -

    • Gather statistics for ressources, methods, and HTTP versions - used by the client. -

    • Also gather statistics for blocked and redirected requests. -

    • Provide the percentage of keep-alive offers the client accepted. -

    • Add a --url-statistics-threshold option. -

    • Add a --host-statistics-threshold option to also gather - statistics about how many request where made per host. -

    • Fix a bug in handle_loglevel_header() where a 'scan: ' got lost. -

    • Add a --shorten-thread-ids option to replace the thread id with - a decimal number. -

    • Accept and ignore: Looks like we got the last chunk together - with the server headers. We better stop reading. -

    • Accept and ignore: Continue hack in da house. -

    • Accept and higlight: Rejecting connection from 10.0.0.2. - Maximum number of connections reached. -

    • Accept and highlight: Loading actions file: /usr/local/etc/privoxy/default.action -

    • Accept and highlight: Loading filter file: /usr/local/etc/privoxy/default.filter -

    • Accept and highlight: Killed all-caps Host header line: HOST: bestproxydb.com -

    • Accept and highlight: Reducing expected bytes to 0. Marking - the server socket tainted after throwing 4 bytes away. -

    • Accept: Merged multiple header lines to: 'X-FORWARDED-PROTO: http X-HOST: 127.0.0.1' -

    -

  • Code cleanups: -

    • Remove the next member from the client_state struct. Only the main - thread needs access to all client states so give it its own struct. -

    • Garbage-collect request_contains_null_bytes(). -

    • Ditch redundant code in unload_configfile(). -

    • Ditch LogGetURLUnderCursor() which doesn't seem to be used anywhere. -

    • In write_socket(), remove the write-only variable write_len in - an ifdef __OS2__ block. Spotted by cppcheck. -

    • In connect_to(), don't declare the variable 'flags' on OS/2 where - it isn't used. Spotted by cppcheck. -

    • Limit the scope of various variables. Spotted by cppcheck. -

    • In add_to_iob(), turn an interestingly looking for loop into a - boring while loop. -

    • Code cleanup in preparation for external filters. -

    • In listen_loop(), mention the socket on which we accepted the - connection, not just the source IP address. -

    • In write_socket(), also log the socket we're writing to. -

    • In log_error(), assert that escaped characters get logged - completely or not at all. -

    • In log_error(), assert that ival and sval have reasonable values. - There's no reason not to abort() if they don't. -

    • Remove an incorrect cgi_error_unknown() call in a - cannnot-happen-situation in send_crunch_response(). -

    • Clean up white-space in http_response definition and - move the crunch_reason to the beginning. -

    • Turn http_response.reason into an enum and rename it - to http_response.crunch_reason. -

    • Silence a 'gcc (Debian 4.3.2-1.1) 4.3.2' warning on i686 GNU/Linux. -

    • Fix white-space in a log message in remove_chunked_transfer_coding(). - While at it, add a note that the message doesn't seem to - be entirely correct and should be improved later on. -

    -

  • GNUmakefile improvements: -

    • Use $(SSH) instead of ssh, so one only needs to specify a username once. -

    • Removed references to the action feedback thingy that hasn't been - working for years. -

    • Consistently use shell.sourceforge.net instead of shell.sf.net so - one doesn't need to check server fingerprints twice. -

    • Removed GNUisms in the webserver and webactions targets so they - work with standard tar. -

    -

3.1. Note to Upgraders

A quick list of things to be aware of before upgrading from earlier - versions of Privoxy:

  • The recommended way to upgrade Privoxy is to backup your old - configuration files, install the new ones, verify that Privoxy - is working correctly and finally merge back your changes using - diff and maybe patch. -

    There are a number of new features in each Privoxy release and - most of them have to be explicitly enabled in the configuration - files. Old configuration files obviously don't do that and due - to syntax changes using old configuration files with a new - Privoxy isn't always possible anyway. -

  • - Note that some installers remove earlier versions completely, - including configuration files, therefore you should really save - any important configuration files! -

  • - On the other hand, other installers don't overwrite existing configuration - files, thinking you will want to do that yourself. -

  • - standard.action has been merged into - the default.action file. -

  • In the default configuration only fatal errors are logged now. - You can change that in the debug section - of the configuration file. You may also want to enable more verbose - logging until you verified that the new Privoxy version is working - as expected. -

  • Three other config file settings are now off by default: - enable-remote-toggle, - enable-remote-http-toggle, - and enable-edit-actions. - If you use or want these, you will need to explicitly enable them, and - be aware of the security issues involved. -


PrevHomeNext
Installation Quickstart to Using Privoxy
+ + + + + + + What's New in this Release + + + + + + + + + + + + + +
+

3. What's New in this + Release

+ +

Privoxy 3.0.19 is a stable release. + The changes since 3.0.18 stable are:

+ +
    +
  • +

    Bug fixes:

    + +
      +
    • +

      Prevent a segmentation fault when de-chunking buffered + content. It could be triggered by malicious web servers if + Privoxy was configured to filter the content and running on a + platform where SIZE_T_MAX isn't larger than UINT_MAX, which + probably includes most 32-bit systems. On those platforms, all + Privoxy versions before 3.0.19 appear to be affected. To be on + the safe side, this bug should be presumed to allow code + execution as proving that it doesn't seems unrealistic.

      +
    • + +
    • +

      Do not expect a response from the SOCKS4/4A server until it + got something to respond to. This regression was introduced in + 3.0.18 and prevented the SOCKS4/4A negotiation from working. + Reported by qqqqqw in #3459781.

      +
    • +
    +
  • + +
  • +

    General improvements:

    + +
      +
    • +

      Fix an off-by-one in an error message about connect + failures.

      +
    • + +
    • +

      Use a GNUMakefile variable for the webserver root directory + and update the path. Sourceforge changed it which broke various + web-related targets.

      +
    • + +
    • +

      Update the CODE_STATUS description.

      +
    • +
    +
  • +
+ +

The following changes were made between 3.0.17 and 3.0.18:

+ +
    +
  • +

    Bug fixes:

    + +
      +
    • +

      If a generated redirect URL contains characters RFC 3986 + doesn't permit, they are (re)encoded. Not doing this makes + Privoxy versions from 3.0.5 to 3.0.17 susceptible to HTTP + response splitting (CWE-113) attacks if the + +fast-redirects{check-decoded-url} action is used.

      +
    • + +
    • +

      Fix a logic bug that could cause Privoxy to reuse a server + socket after it got tainted by a server-header-tagger-induced + block that was triggered before the whole server response had + been read. If keep-alive was enabled and the request following + the blocked one was to the same host and using the same + forwarding settings, Privoxy would send it on the tainted server + socket. While the server would simply treat it as a pipelined + request, Privoxy would later on fail to properly parse the + server's response as it would try to parse the unread data from + the first response as server headers for the second one. + Regression introduced in 3.0.17.

      +
    • + +
    • +

      When implying keep-alive in client_connection(), remember that + the client didn't. Fixes a regression introduced in 3.0.13 that + would cause Privoxy to wait for additional client requests after + receiving a HTTP/1.1 request with "Connection: close" set and + connection sharing enabled. With clients which terminates the + client connection after detecting that the whole body has been + received it doesn't really matter, but with clients that don't + the connection would be kept open until it timed out.

      +
    • + +
    • +

      Fix a subtle race condition between + prepare_csp_for_next_request() and sweep(). A thread preparing + itself for the next client request could briefly appear to be + inactive. If all other threads were already using more recent + files, the thread could get its files swept away under its feet. + So far this has only been reproduced while stress testing in + valgrind while touching action files in a loop. It's unlikely to + have caused any actual problems in the real world.

      +
    • + +
    • +

      Disable filters if SDCH compression is used unless filtering + is forced. If SDCH was combined with a supported compression + algorithm, Privoxy previously could try to decompress it and + ditch the Content-Encoding header even though the SDCH + compression wasn't dealt with. Reported by zebul666 in + #3225863.

      +
    • + +
    • +

      Make a copy of the --user value and only mess with that when + splitting user and group. On some operating systems modifying the + value directly is reflected in the output of ps and friends and + can be misleading. Reported by zepard in #3292710.

      +
    • + +
    • +

      If forwarded-connect-retries is set, only retry if Privoxy is + actually forwarding the request. Previously direct connections + would be retried as well.

      +
    • + +
    • +

      Fixed a small memory leak when retrying connections with IPv6 + support enabled.

      +
    • + +
    • +

      Remove an incorrect assertion in + compile_dynamic_pcrs_job_list() It could be triggered by a pcrs + job with an invalid pcre pattern (for example one that contains a + lone quantifier).

      +
    • + +
    • +

      If the --user argument user[.group] contains a dot, always + bail out if no group has been specified. Previously the intended, + but undocumented (and apparently untested), behaviour was to try + interpreting the whole argument as user name, but the detection + was flawed and checked for '0' instead of '\0', thus merely + preventing group names beginning with a zero.

      +
    • + +
    • +

      In html_code_map[], use a numeric character reference instead + of ' which wasn't standardized before XHTML 1.0.

      +
    • + +
    • +

      Fix an invalid free when compiled with + FEATURE_GRACEFUL_TERMINATION and shut down through + http://config.privoxy.org/die

      +
    • + +
    • +

      In get_actions(), fix the "temporary" backwards compatibility + hack to accept block actions without reason. It also covered + other actions that should be rejected as invalid. Reported by + Billy Crook.

      +
    • +
    +
  • + +
  • +

    General improvements:

    + +
      +
    • +

      Privoxy can (re)compress buffered content before delivering it + to the client. Disabled by default as most users wouldn't benefit + from it.

      +
    • + +
    • +

      The +fast-redirects{check-decoded-url} action checks URL + segments separately. If there are other parameters behind the + redirect URL, this makes it unnecessary to cut them off by + additionally using a +redirect{} pcrs command. Initial patch + submitted by Jamie Zawinski in #3429848.

      +
    • + +
    • +

      When loading action sections, verify that the referenced + filters exist. Currently missing filters only result in an error + message, but eventually the severity will be upgraded to + fatal.

      +
    • + +
    • +

      Allow to bind to multiple separate addresses. Patch set + submitted by Petr Pisar in #3354485.

      +
    • + +
    • +

      Set socket_error to errno if connecting fails in + rfc2553_connect_to(). Previously rejected direct connections + could be incorrectly reported as DNS issues if Privoxy was + compiled with IPv6 support.

      +
    • + +
    • +

      Adjust url_code_map[] so spaces are replaced with %20 instead + of '+' While '+' can be used by client's submitting form data, + this is not actually what Privoxy is using the lookups for. This + is more of a cosmetic issue and doesn't fix any known + problems.

      +
    • + +
    • +

      When compiled without FEATURE_FAST_REDIRECTS, do not silently + ignore +fast-redirect{} directives

      +
    • + +
    • +

      Added a workaround for GNU libc's strptime() reporting + negative year values when the parsed year is only specified with + two digits. On affected systems cookies with such a date would + not be turned into session cookies by the +session-cookies-only + action. Reported by Vaeinoe in #3403560

      +
    • + +
    • +

      Fixed bind failures with certain GNU libc versions if no + non-loopback IP address has been configured on the system. This + is mainly an issue if the system is using DHCP and Privoxy is + started before the network is completely configured. Reported by + Raphael Marichez in #3349356. Additional insight from Petr + Pisar.

      +
    • + +
    • +

      Privoxy log messages now use the ISO 8601 date format + %Y-%m-%d. It's only slightly longer than the old format, but + contains the full date including the year and allows sorting by + date (when grepping in multiple log files) without hassle.

      +
    • + +
    • +

      In get_last_url(), do not bother trying to decode URLs that do + not contain at least one '%' sign. It reduces the log noise and a + number of unnecessary memory allocations.

      +
    • + +
    • +

      In case of SOCKS5 failures, dump the socks response in the log + message.

      +
    • + +
    • +

      Simplify the signal setup in main().

      +
    • + +
    • +

      Streamline socks5_connect() slightly.

      +
    • + +
    • +

      In socks5_connect(), require a complete socks response from + the server. Previously Privoxy didn't care how much data the + server response contained as long as the first two bytes + contained the expected values. While at it, shrink the buffer + size so Privoxy can't read more than a whole socks response.

      +
    • + +
    • +

      In chat(), do not bother to generate a client request in case + of direct CONNECT requests. It will not be used anyway.

      +
    • + +
    • +

      Reduce server_last_modified()'s stack size.

      +
    • + +
    • +

      Shorten get_http_time() by using strftime().

      +
    • + +
    • +

      Constify the known_http_methods pointers in + unknown_method().

      +
    • + +
    • +

      Constify the time_formats pointers in parse_header_time().

      +
    • + +
    • +

      Constify the formerly_valid_actions pointers in + action_used_to_be_valid().

      +
    • + +
    • +

      Introduce a GNUMakefile MAN_PAGE variable that defaults to + privoxy.1. The Debian package uses section 8 for the man page and + this should simplify the patch.

      +
    • + +
    • +

      Deduplicate the INADDR_NONE definition for Solaris by moving + it to jbsockets.h

      +
    • + +
    • +

      In block_url(), ditch the obsolete workaround for ancient + Netscape versions that supposedly couldn't properly deal with + status code 403.

      +
    • + +
    • +

      Remove a useless NULL pointer check in load_trustfile().

      +
    • + +
    • +

      Remove two useless NULL pointer checks in + load_one_re_filterfile().

      +
    • + +
    • +

      Change url_code_map[] from an array of pointers to an array of + arrays It removes an unnecessary layer of indirection and on + 64bit system reduces the size of the binary a bit.

      +
    • + +
    • +

      Fix various typos. Fixes taken from Debian's 29_typos.dpatch + by Roland Rosenfeld.

      +
    • + +
    • +

      Add a dok-tidy GNUMakefile target to clean up the messy HTML + generated by the other dok targets.

      +
    • + +
    • +

      GNUisms in the GNUMakefile have been removed.

      +
    • + +
    • +

      Change the HTTP version in static responses to 1.1

      +
    • + +
    • +

      Synced config.sub and config.guess with upstream + 2011-11-11/386c7218162c145f5f9e1ff7f558a3fbb66c37c5.

      +
    • + +
    • +

      Add a dedicated function to parse the values of toggles. + Reduces duplicated code in load_config() and provides better + error handling. Invalid or missing toggle values are now a fatal + error instead of being silently ignored.

      +
    • + +
    • +

      Terminate HTML lines in static error messages with \n instead + of \r\n.

      +
    • + +
    • +

      Simplify cgi_error_unknown() a bit.

      +
    • + +
    • +

      In LogPutString(), don't bother looking at pszText when not + actually logging anything.

      +
    • + +
    • +

      Change ssplit()'s fourth parameter from int to size_t. Fixes a + clang complaint.

      +
    • + +
    • +

      Add a warning that the statistics currently can't be trusted. + Mention Privoxy-Log-Parser's --statistics option as an + alternative for the time being.

      +
    • + +
    • +

      In rfc2553_connect_to(), start setting cgi->error_message + on error.

      +
    • + +
    • +

      Change the expected status code returned for http://p.p/die + depending on whether or not FEATURE_GRACEFUL_TERMINATION is + available.

      +
    • + +
    • +

      In cgi_die(), mark the client connection for closing. If the + client will fetch the style sheet through another connection it + gets the main thread out of the accept() state and should thus + trigger the actual shutdown.

      +
    • + +
    • +

      Add a proper CGI message for cgi_die().

      +
    • + +
    • +

      Don't enforce a logical line length limit in + read_config_line().

      +
    • + +
    • +

      Slightly refactor server_last_modified() to remove useless + gmtime*() calls.

      +
    • + +
    • +

      In get_content_type(), also recognize '.jpeg' as JPEG + extension.

      +
    • + +
    • +

      Add '.png' to the list of recognized file extensions in + get_content_type().

      +
    • + +
    • +

      In block_url(), consistently use the block reason "Request + blocked by Privoxy" In two places the reason was "Request for + blocked URL" which hides the fact that the request got blocked by + Privoxy and isn't necessarily correct as the block may be due to + tags.

      +
    • + +
    • +

      In listen_loop(), reload the configuration files after + accepting a new connection instead of before. Previously the + first connection that arrived after a configuration change would + still be handled with the old configuration.

      +
    • + +
    • +

      In chat()'s receive-data loop, skip a client socket check if + the socket will be written to right away anyway. This can + increase the transfer speed for unfiltered content on fast + network connections.

      +
    • + +
    • +

      The socket timeout is used for SOCKS negotiations as well + which previously couldn't timeout.

      +
    • + +
    • +

      Don't keep the client connection alive if any configuration + file changed since the time the connection came in. This is + closer to Privoxy's behaviour before keep-alive support for + client connection has been added and also less confusing in + general.

      +
    • + +
    • +

      Treat all Content-Type header values containing the pattern + 'script' as a sign of text. Reported by pribog in #3134970.

      +
    • +
    +
  • + +
  • +

    Action file improvements:

    + +
      +
    • +

      Moved the site-specific block pattern section below the one + for the generic patterns so for requests that are matched in + both, the block reason for the domain is shown which is usually + more useful than showing the one for the generic pattern.

      +
    • + +
    • +

      Remove -prevent-compression from the fragile alias. It's no + longer used anywhere by default and isn't known to break stuff + anyway.

      +
    • + +
    • +

      Add a (disabled) section to block various Facebook tracking + URLs. Reported by Dan Stahlke in #3421764.

      +
    • + +
    • +

      Add a (disabled) section to rewrite and redirect + click-tracking URLs used on news.google.com. Reported by Dan + Stahlke in #3421755.

      +
    • + +
    • +

      Unblock linuxcounter.net/. Reported by Dan Stahlke in + #3422612.

      +
    • + +
    • +

      Block 'www91.intel.com/' which is used by Omniture. Reported + by Adam Piggott in #3167370.

      +
    • + +
    • +

      Disable the handle-as-empty-doc-returns-ok option and mark it + as deprecated. Reminded by tceverling in #2790091.

      +
    • + +
    • +

      Add ".ivwbox.de/" to the "Cross-site user tracking" section. + Reported by Nettozahler in #3172525.

      +
    • + +
    • +

      Unblock and fast-redirect ".awin1.com/.*=http://". Reported by + Adam Piggott in #3170921.

      +
    • + +
    • +

      Block "b.collective-media.net/".

      +
    • + +
    • +

      Widen the Debian popcon exception to "qa.debian.org/popcon". + Seen in Debian's 05_default_action.dpatch by Roland + Rosenfeld.

      +
    • + +
    • +

      Block ".gemius.pl/" which only seems to be used for user + tracking. Reported by johnd16 in #3002731. Additional input from + Lee and movax.

      +
    • + +
    • +

      Disable banners-by-size filters for '.thinkgeek.com/'. The + filter only seems to catch pictures of the inventory.

      +
    • + +
    • +

      Block requests for 'go.idmnet.bbelements.com/please/showit/'. + Reported by kacperdominik in #3372959.

      +
    • + +
    • +

      Unblock adainitiative.org/.

      +
    • + +
    • +

      Add a fast-redirects exception for + '.googleusercontent.com/.*=cache'.

      +
    • + +
    • +

      Add a fast-redirects exception for + webcache.googleusercontent.com/.

      +
    • + +
    • +

      Unblock http://adassier.wordpress.com/ and + http://adassier.files.wordpress.com/.

      +
    • +
    +
  • + +
  • +

    Filter file improvements:

    + +
      +
    • +

      Let the yahoo filter hide '.ads'.

      +
    • + +
    • +

      Let the msn filter hide overlay ads for Facebook 'likes' in + search results and elements with the id 's_notf_div'. They only + seem to be used to advertise site 'enhancements'.

      +
    • + +
    • +

      Let the js-events filter additionally disarm setInterval(). + Suggested by dg1727 in #3423775.

      +
    • +
    +
  • + +
  • +

    Documentation improvements:

    + +
      +
    • +

      Clarify the effect of compiling Privoxy with zlib support. + Suggested by dg1727 in #3423782.

      +
    • + +
    • +

      Point out that the SourceForge messaging system works like a + black hole and should thus not be used to contact individual + developers.

      +
    • + +
    • +

      Mention some of the problems one can experience when not + explicitly configuring an IP addresses as listen address.

      +
    • + +
    • +

      Explicitly mention that hostnames can be used instead of IP + addresses for the listen-address, that only the first address + returned will be used and what happens if the address is invalid. + Requested by Calestyo in #3302213.

      +
    • +
    +
  • + +
  • +

    Log message improvements:

    + +
      +
    • +

      If only the server connection is kept alive, do not pretend to + wait for a new client request.

      +
    • + +
    • +

      Remove a superfluous log message in forget_connection().

      +
    • + +
    • +

      In chat(), properly report missing server responses as such + instead of calling them empty.

      +
    • + +
    • +

      In forwarded_connect(), fix a log message nobody should ever + see.

      +
    • + +
    • +

      Fix a log message in socks5_connect(), a failed write + operation was logged as failed read operation.

      +
    • + +
    • +

      Let load_one_actions_file() properly complain about a missing + '{' at the beginning of the file. Simply stating that a line is + invalid isn't particularly helpful.

      +
    • + +
    • +

      Do not claim to listen on a socket until Privoxy actually + does. Patch submitted by Petr Pisar #3354485

      +
    • + +
    • +

      Prevent a duplicated LOG_LEVEL_CLF message when sending out + the "no-server-data" response.

      +
    • + +
    • +

      Also log the client socket when dropping a connection.

      +
    • + +
    • +

      Include the destination host in the 'Request ... marked for + blocking. limit-connect{...} doesn't allow CONNECT ...' message + Patch submitted by Saperski in #3296250.

      +
    • + +
    • +

      Prevent a duplicated log message if none of the resolved IP + addresses were reachable.

      +
    • + +
    • +

      In connect_to(), do not pretend to retry if + forwarded-connect-retries is zero or unset.

      +
    • + +
    • +

      When a specified user or group can't be found, put the name in + single-quotes when logging it.

      +
    • + +
    • +

      In rfc2553_connect_to(), explain getnameinfo() errors + better.

      +
    • + +
    • +

      Remove a useless log message in chat().

      +
    • + +
    • +

      When retrying to connect, also log the maximum number of + connection attempts.

      +
    • + +
    • +

      Rephrase a log message in compile_dynamic_pcrs_job_list(). + Divide the error code and its meaning with a colon. Call the pcrs + job dynamic and not the filter. Filters may contain dynamic and + non-dynamic pcrs jobs at the same time. Only mention the name of + the filter or tagger, but don't claim it's a filter when it could + be a tagger.

      +
    • + +
    • +

      In a fatal error message in load_one_actions_file(), cover + both URL and TAG patterns.

      +
    • + +
    • +

      In pcrs_strerror(), properly report unknown positive error + code values as such. Previously they were handled like 0 (no + error).

      +
    • + +
    • +

      In compile_dynamic_pcrs_job_list(), also log the actual error + code as pcrs_strerror() doesn't handle all errors reported by + pcre.

      +
    • + +
    • +

      Don't bother trying to continue chatting if the client didn't + ask for it. Reduces log noise a bit.

      +
    • + +
    • +

      Make two fatal error message in load_one_actions_file() more + descriptive.

      +
    • + +
    • +

      In cgi_send_user_manual(), log when rejecting a file name due + to '/' or '..'.

      +
    • + +
    • +

      In load_file(), log a message if opening a file failed. The + CGI error message alone isn't too helpful.

      +
    • + +
    • +

      In connection_destination_matches(), improve two log messages + to help understand why the destinations don't match.

      +
    • + +
    • +

      Rephrase a log message in serve(). Client request arrival + should be differentiated from closed client connections now.

      +
    • + +
    • +

      In serve(), log if a client connection isn't reused due to a + configuration file change.

      +
    • + +
    • +

      Let mark_server_socket_tainted() always mark the server socket + tainted, just don't talk about it in cases where it has no + effect. It doesn't change Privoxy's behaviour, but makes + understanding the log file easier.

      +
    • +
    +
  • + +
  • +

    configure:

    + +
      +
    • +

      Added a --disable-ipv6-support switch for platforms where + support is detected but doesn't actually work.

      +
    • + +
    • +

      Do not check for the existence of strerror() and memmove() + twice

      +
    • + +
    • +

      Remove a useless test for setpgrp(2). Privoxy doesn't need it + and it can cause problems when cross-compiling.

      +
    • + +
    • +

      Rename the --disable-acl-files switch to + --disable-acl-support. Since about 2001, ACL directives are + specified in the standard config file.

      +
    • + +
    • +

      Update the URL of the 'Removing outdated PCRE version after + the next stable release' posting. The old URL stopped working + after one of SF's recent site "optimizations". Reported by Han + Liu.

      +
    • +
    +
  • + +
  • +

    Privoxy-Regression-Test:

    + +
      +
    • +

      Added --shuffle-tests option to increase the chances of + detection race conditions.

      +
    • + +
    • +

      Added a --local-test-file option that allows to use + Privoxy-Regression-Test without Privoxy.

      +
    • + +
    • +

      Added tests for missing socks4 and socks4a forwarders.

      +
    • + +
    • +

      The --privoxy-address option now works with IPv6 addresses + containing brackets, too.

      +
    • + +
    • +

      Perform limited sanity checks for parameters that are supposed + to have numerical values.

      +
    • + +
    • +

      Added a --sleep-time option to specify a number of seconds to + sleep between tests, defaults to 0.

      +
    • + +
    • +

      Disable the range-requests tagger for tests that break if it's + enabled.

      +
    • + +
    • +

      Log messages use the ISO 8601 date format %Y-%m-%d.

      +
    • + +
    • +

      Fix spelling in two error messages.

      +
    • + +
    • +

      In the --help output, include a list of supported tests and + their default levels.

      +
    • + +
    • +

      Adjust the tests to properly deal with FEATURE_TOGGLE being + disabled.

      +
    • +
    +
  • + +
  • +

    Privoxy-Log-Parser:

    + +
      +
    • +

      Perform limited sanity checks for command line parameters that + are supposed to have numerical values.

      +
    • + +
    • +

      Implement a --unbreak-lines-only option to try to revert MUA + breakage.

      +
    • + +
    • +

      Accept and highlight: Added header: Content-Encoding: + deflate

      +
    • + +
    • +

      Accept and highlight: Compressed content from 29258 to 8630 + bytes.

      +
    • + +
    • +

      Accept and highlight: Client request arrived in time on socket + 21.

      +
    • + +
    • +

      Highlight: Didn't receive data in time: a.fsdn.com:443

      +
    • + +
    • +

      Accept log messages with ISO 8601 time stamps, too.

      +
    • +
    +
  • + +
  • +

    uagen:

    + +
      +
    • +

      Bump generated Firefox version to 8.0.

      +
    • + +
    • +

      Only randomize the release date if the new + --randomize-release-date option is enabled. Firefox versions + after 4 use a fixed date string without meaning.

      +
    • +
    +
  • +
+ +
+

3.1. Note + to Upgraders

+ +

A quick list of things to be aware of before upgrading from earlier + versions of Privoxy:

+ +
    +
  • +

    The recommended way to upgrade Privoxy is to backup your old configuration + files, install the new ones, verify that Privoxy is working correctly and finally merge + back your changes using diff and + maybe patch.

    + +

    There are a number of new features in each Privoxy release and most of them have to be + explicitly enabled in the configuration files. Old configuration + files obviously don't do that and due to syntax changes using old + configuration files with a new Privoxy isn't always possible anyway.

    +
  • + +
  • +

    Note that some installers remove earlier versions completely, + including configuration files, therefore you should really save any + important configuration files!

    +
  • + +
  • +

    On the other hand, other installers don't overwrite existing + configuration files, thinking you will want to do that + yourself.

    +
  • + +
  • +

    standard.action has been merged into + the default.action file.

    +
  • + +
  • +

    In the default configuration only fatal errors are logged now. + You can change that in the debug + section of the configuration file. You may also want to enable + more verbose logging until you verified that the new Privoxy version is working as expected.

    +
  • + +
  • +

    Three other config file settings are now off by default: + enable-remote-toggle, + enable-remote-http-toggle, + and enable-edit-actions. If you + use or want these, you will need to explicitly enable them, and be + aware of the security issues involved.

    +
  • +
+
+
+ + + + diff -Nru privoxy-3.0.17/encode.c privoxy-3.0.19/encode.c --- privoxy-3.0.17/encode.c 2010-09-09 21:00:25.000000000 +0000 +++ privoxy-3.0.19/encode.c 2011-11-06 11:51:57.000000000 +0000 @@ -1,4 +1,4 @@ -const char encode_rcs[] = "$Id: encode.c,v 1.17 2010/09/09 21:00:25 fabiankeil Exp $"; +const char encode_rcs[] = "$Id: encode.c,v 1.24 2011/11/06 11:51:57 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/encode.c,v $ @@ -10,10 +10,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -47,20 +47,20 @@ const char encode_h_rcs[] = ENCODE_H_VERSION; /* Maps special characters in a URL to their equivalent % codes. */ -static const char * const url_code_map[256] = { - NULL, "%01", "%02", "%03", "%04", "%05", "%06", "%07", "%08", "%09", +static const char const url_code_map[256][4] = { + "", "%01", "%02", "%03", "%04", "%05", "%06", "%07", "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F", "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17", "%18", "%19", "%1A", "%1B", "%1C", "%1D", - "%1E", "%1F", "+", "%21", "%22", "%23", "%24", "%25", "%26", "%27", - "%28", "%29", NULL, "%2B", "%2C", NULL, NULL, "%2F", NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "%3A", "%3B", - "%3C", "%3D", "%3E", "%3F", NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, "%5B", "%5C", "%5D", "%5E", NULL, "%60", NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, "%7B", "%7C", "%7D", "%7E", "%7F", "%80", "%81", + "%1E", "%1F", "%20", "%21", "%22", "%23", "%24", "%25", "%26", "%27", + "%28", "%29", "", "%2B", "%2C", "", "", "%2F", "", "", + "", "", "", "", "", "", "", "", "%3A", "%3B", + "%3C", "%3D", "%3E", "%3F", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "%5B", "%5C", "%5D", "%5E", "", "%60", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "%7B", "%7C", "%7D", "%7E", "%7F", "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87", "%88", "%89", "%8A", "%8B", "%8C", "%8D", "%8E", "%8F", "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97", "%98", "%99", "%9A", "%9B", "%9C", "%9D", "%9E", "%9F", @@ -76,12 +76,12 @@ "%FA", "%FB", "%FC", "%FD", "%FE", "%FF" }; -/* Maps special characters in HTML to their equivalent entites. */ +/* Maps special characters in HTML to their equivalent entities. */ static const char * const html_code_map[256] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL,""",NULL,NULL,NULL,"&","'", + NULL, NULL, NULL, NULL,""",NULL,NULL,NULL,"&","'", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "<",NULL,">",NULL,NULL, NULL, NULL, NULL, NULL, NULL, @@ -119,7 +119,7 @@ * Parameters : * 1 : s = String to encode. Null-terminated. * - * Returns : Encoded string, newly allocated on the heap. + * Returns : Encoded string, newly allocated on the heap. * Caller is responsible for freeing it with free(). * If s is NULL, or on out-of memory, returns NULL. * @@ -128,7 +128,7 @@ { char * buf; size_t buf_size; - + if (s == NULL) { return NULL; @@ -178,7 +178,7 @@ * Parameters : * 1 : s = String to encode. Null-terminated. * - * Returns : Encoded string, newly allocated on the heap. + * Returns : Encoded string, newly allocated on the heap. * Caller is responsible for freeing it with free(). * If s is NULL, or on out-of memory, returns NULL. * @@ -186,7 +186,7 @@ char * html_encode_and_free_original(char *s) { char * result; - + if (s == NULL) { return NULL; @@ -207,10 +207,13 @@ * query string. Replaces special characters with * the appropriate %xx codes. * + * XXX: url_query_encode() would be a more fitting + * name. + * * Parameters : * 1 : s = String to encode. Null-terminated. * - * Returns : Encoded string, newly allocated on the heap. + * Returns : Encoded string, newly allocated on the heap. * Caller is responsible for freeing it with free(). * If s is NULL, or on out-of memory, returns NULL. * @@ -235,8 +238,8 @@ char * p = buf; while( (c = *s++) != '\0') { - const char * replace_with = url_code_map[(unsigned char) c]; - if (replace_with != NULL) + const char *replace_with = url_code_map[(unsigned char) c]; + if (*replace_with != '\0') { const size_t bytes_written = (size_t)(p - buf); assert(bytes_written < buf_size); @@ -275,7 +278,7 @@ { return(d - '0'); } - else if ((d >= 'a') && (d <= 'f')) + else if ((d >= 'a') && (d <= 'f')) { return(d - 'a' + 10); } @@ -331,7 +334,7 @@ * Parameters : * 1 : s = String to decode. Null-terminated. * - * Returns : Decoded string, newly allocated on the heap. + * Returns : Decoded string, newly allocated on the heap. * Caller is responsible for freeing it with free(). * *********************************************************************/ @@ -377,6 +380,83 @@ } +/********************************************************************* + * + * Function : percent_encode_url + * + * Description : Percent-encodes a string so it no longer contains + * any characters that aren't valid in an URL according + * to RFC 3986. + * + * XXX: Do not confuse with encode_url() + * + * Parameters : + * 1 : s = String to encode. Null-terminated. + * + * Returns : Encoded string, newly allocated on the heap. + * Caller is responsible for freeing it with free(). + * If s is NULL, or on out-of memory, returns NULL. + * + *********************************************************************/ +char *percent_encode_url(const char *s) +{ + static const char allowed_characters[128] = { + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '!', '\0', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', + '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', + '\0', '=', '\0', '?', '@', 'A', 'B', 'C', 'D', 'E', + 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', + 'Z', '[', '\0', ']', '\0', '_', '\0', 'a', 'b', 'c', + 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '\0', '\0', '\0', '~', '\0' + }; + char *buf; + size_t buf_size; + + assert(s != NULL); + + /* Each input char can expand to at most 3 chars. */ + buf_size = (strlen(s) * 3) + 1; + buf = (char *)malloc(buf_size); + + if (buf != NULL) + { + char c; + char *p = buf; + while((c = *s++) != '\0') + { + const unsigned int i = (unsigned char)c; + if (i >= sizeof(allowed_characters) || '\0' == allowed_characters[i]) + { + const char *replace_with = url_code_map[i]; + assert(*replace_with != '\0'); + if (*replace_with != '\0') + { + const size_t bytes_written = (size_t)(p - buf); + assert(bytes_written < buf_size); + p += strlcpy(p, replace_with, buf_size - bytes_written); + } + } + else + { + *p++ = c; + } + } + *p = '\0'; + } + + assert(strlen(buf) < buf_size); + + return(buf); + +} + + /* Local Variables: tab-width: 3 diff -Nru privoxy-3.0.17/encode.h privoxy-3.0.19/encode.h --- privoxy-3.0.17/encode.h 2009-06-21 19:21:13.000000000 +0000 +++ privoxy-3.0.19/encode.h 2011-11-06 11:44:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef ENCODE_H_INCLUDED #define ENCODE_H_INCLUDED -#define ENCODE_H_VERSION "$Id: encode.h,v 1.10 2009/05/16 13:27:20 fabiankeil Exp $" +#define ENCODE_H_VERSION "$Id: encode.h,v 1.12 2011/11/06 11:44:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/encode.h,v $ @@ -12,10 +12,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -45,6 +45,7 @@ extern char * url_decode(const char *str); extern int xtoi(const char *s); extern char * html_encode_and_free_original(char *s); +extern char * percent_encode_url(const char *s); /* Revision control strings from this header and associated .c file */ extern const char encode_rcs[]; diff -Nru privoxy-3.0.17/errlog.c privoxy-3.0.19/errlog.c --- privoxy-3.0.17/errlog.c 2010-07-26 12:11:51.000000000 +0000 +++ privoxy-3.0.19/errlog.c 2011-09-04 11:10:56.000000000 +0000 @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.110 2010/07/26 12:11:51 fabiankeil Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.112 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -10,10 +10,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -121,9 +121,9 @@ #else /* ! MUTEX_LOCKS_AVAILABLE */ /* * FIXME we need a cross-platform locking mechanism. - * The locking/unlocking functions below should be + * The locking/unlocking functions below should be * fleshed out for non-pthread implementations. - */ + */ static inline void lock_logfile() {} static inline void unlock_logfile() {} static inline void lock_loginit() {} @@ -134,7 +134,7 @@ * * Function : fatal_error * - * Description : Displays a fatal error to standard error (or, on + * Description : Displays a fatal error to standard error (or, on * a WIN32 GUI, to a dialog box), and exits Privoxy * with status code 1. * @@ -154,8 +154,8 @@ /* Shouldn't happen but ... */ box_message = error_message; } - MessageBox(g_hwndLogFrame, box_message, "Privoxy Error", - MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST); + MessageBox(g_hwndLogFrame, box_message, "Privoxy Error", + MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST); /* Cleanup - remove taskbar icon etc. */ TermLogWindow(); @@ -232,7 +232,7 @@ * XXX: we should only use the LOG_LEVEL_MINIMUM * until the first time the configuration file has * been parsed. - * + * * Parameters : 1: debug_level = The debug level to set. * * Returns : Nothing. @@ -249,7 +249,7 @@ * Function : disable_logging * * Description : Disables logging. - * + * * Parameters : None. * * Returns : Nothing. @@ -375,7 +375,7 @@ * Description : Returns a number that is different for each thread. * * XXX: Should be moved elsewhere (miscutil.c?) - * + * * Parameters : None * * Returns : thread_id @@ -430,7 +430,7 @@ static inline size_t get_log_timestamp(char *buffer, size_t buffer_size) { size_t length; - time_t now; + time_t now; struct tm tm_now; struct timeval tv_now; /* XXX: stupid name */ long msecs; @@ -444,16 +444,16 @@ tm_now = *localtime_r(&now, &tm_now); #elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&localtime_mutex); - tm_now = *localtime(&now); + tm_now = *localtime(&now); privoxy_mutex_unlock(&localtime_mutex); #else - tm_now = *localtime(&now); + tm_now = *localtime(&now); #endif - length = strftime(buffer, buffer_size, "%b %d %H:%M:%S", &tm_now); + length = strftime(buffer, buffer_size, "%Y-%m-%d %H:%M:%S", &tm_now); if (length > (size_t)0) { - msecs_length = snprintf(buffer+length, buffer_size - length, ".%.3ld", msecs); + msecs_length = snprintf(buffer+length, buffer_size - length, ".%.3ld", msecs); } if (msecs_length > 0) { @@ -488,7 +488,7 @@ * the %z field in strftime() */ time_t now; - struct tm *tm_now; + struct tm *tm_now; struct tm gmt; #ifdef HAVE_LOCALTIME_R struct tm dummy; @@ -497,7 +497,7 @@ size_t length; int tz_length = 0; - time (&now); + time (&now); #ifdef HAVE_GMTIME_R gmt = *gmtime_r(&now, &gmt); #elif defined(MUTEX_LOCKS_AVAILABLE) @@ -511,14 +511,14 @@ tm_now = localtime_r(&now, &dummy); #elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&localtime_mutex); - tm_now = localtime(&now); + tm_now = localtime(&now); privoxy_mutex_unlock(&localtime_mutex); #else - tm_now = localtime(&now); + tm_now = localtime(&now); #endif - days = tm_now->tm_yday - gmt.tm_yday; - hrs = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) + tm_now->tm_hour - gmt.tm_hour); - mins = hrs * 60 + tm_now->tm_min - gmt.tm_min; + days = tm_now->tm_yday - gmt.tm_yday; + hrs = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) + tm_now->tm_hour - gmt.tm_hour); + mins = hrs * 60 + tm_now->tm_min - gmt.tm_min; length = strftime(buffer, buffer_size, "%d/%b/%Y:%H:%M:%S ", tm_now); @@ -546,7 +546,7 @@ * * Description : Translates a numerical loglevel into a string. * - * Parameters : + * Parameters : * 1 : loglevel = LOG_LEVEL_FOO * * Returns : Log level string. @@ -682,7 +682,7 @@ /* protect the whole function because of the static buffer (outbuf) */ lock_logfile(); - if (NULL == outbuf_save) + if (NULL == outbuf_save) { outbuf_save = (char*)zalloc(log_buffer_size + 1); /* +1 for paranoia */ if (NULL == outbuf_save) @@ -840,7 +840,7 @@ format_string = strerror(ival); } #else /* ifndef _WIN32 */ - ival = errno; + ival = errno; #ifdef HAVE_STRERROR format_string = strerror(ival); #else /* ifndef HAVE_STRERROR */ diff -Nru privoxy-3.0.17/errlog.h privoxy-3.0.19/errlog.h --- privoxy-3.0.17/errlog.h 2010-07-26 11:30:09.000000000 +0000 +++ privoxy-3.0.19/errlog.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef ERRLOG_H_INCLUDED #define ERRLOG_H_INCLUDED -#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.26 2010/07/26 11:30:09 fabiankeil Exp $" +#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.27 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.h,v $ @@ -12,10 +12,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/filters.c privoxy-3.0.19/filters.c --- privoxy-3.0.17/filters.c 2010-11-13 11:09:54.000000000 +0000 +++ privoxy-3.0.19/filters.c 2011-12-26 17:03:08.000000000 +0000 @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.137 2010/11/13 11:09:54 fabiankeil Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.163 2011/12/26 17:03:08 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -13,7 +13,7 @@ * `execute_single_pcrs_command', `rewrite_url', * `get_last_url' * - * Copyright : Written by and Copyright (C) 2001-2010 the + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -485,7 +485,7 @@ * of octets (128-bit CPU could do it in one iteration). */ /* - * Octets after prefix can be ommitted because of + * Octets after prefix can be omitted because of * previous initialization to zeros. */ for (i = 0; (i < addr_len) && masklength; i++) @@ -574,7 +574,7 @@ } if (csp->action->flags & ACTION_REDIRECT) { - log_error(LOG_LEVEL_ERROR, "redirect{} overruled by block."); + log_error(LOG_LEVEL_ERROR, "redirect{} overruled by block."); } /* * Else, prepare a response @@ -668,7 +668,7 @@ if(csp->action->flags & ACTION_HANDLE_AS_EMPTY_DOCUMENT) { /* - * Send empty document. + * Send empty document. */ new_content_type = csp->action->string[ACTION_STRING_CONTENT_TYPE]; @@ -714,27 +714,8 @@ { jb_err err; struct map * exports; - char *p; - - /* - * Workaround for stupid Netscape bug which prevents - * pages from being displayed if loading a referenced - * JavaScript or style sheet fails. So make it appear - * as if it succeeded. - */ - if ( NULL != (p = get_header_value(csp->headers, "User-Agent:")) - && !strncmpic(p, "mozilla", 7) /* Catch Netscape but */ - && !strstr(p, "Gecko") /* save Mozilla, */ - && !strstr(p, "compatible") /* MSIE */ - && !strstr(p, "Opera")) /* and Opera. */ - { - rsp->status = strdup("200 Request for blocked URL"); - } - else - { - rsp->status = strdup("403 Request for blocked URL"); - } + rsp->status = strdup("403 Request blocked by Privoxy"); if (rsp->status == NULL) { free_http_response(rsp); @@ -855,7 +836,7 @@ * Export the protocol, host, port, and referrer information */ err = map(exports, "hostport", 1, csp->http->hostport, 1); - if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); + if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); if (!err) err = map(exports, "path", 1, csp->http->path, 1); if (NULL != (p = get_header_value(csp->headers, "Referer:"))) @@ -975,7 +956,7 @@ * 2 : b = The filter list to compile * * Returns : NULL in case of errors, otherwise the - * pcrs job list. + * pcrs job list. * *********************************************************************/ pcrs_job *compile_dynamic_pcrs_job_list(const struct client_state *csp, const struct re_filterfile_spec *b) @@ -1002,10 +983,9 @@ dummy = pcrs_compile_dynamic_command(pattern->str, variables, &error); if (NULL == dummy) { - assert(error < 0); log_error(LOG_LEVEL_ERROR, - "Adding filter job \'%s\' to dynamic filter %s failed: %s", - pattern->str, b->name, pcrs_strerror(error)); + "Compiling dynamic pcrs job '%s' for '%s' failed with error code %d: %s", + pattern->str, b->name, error, pcrs_strerror(error)); continue; } else @@ -1045,7 +1025,7 @@ * 2 : pcrs_command = pcrs command formatted as string (s@foo@bar@) * * - * Returns : NULL if the pcrs_command didn't change the url, or + * Returns : NULL if the pcrs_command didn't change the url, or * the result of the modification. * *********************************************************************/ @@ -1104,7 +1084,7 @@ * * Parameters : * 1 : subject = the string to check - * 2 : redirect_mode = +fast-redirect{} mode + * 2 : redirect_mode = +fast-redirect{} mode * * Returns : NULL if no URL was found, or * the last URL found. @@ -1125,22 +1105,78 @@ return NULL; } - if (0 == strcmpic(redirect_mode, "check-decoded-url")) + if (0 == strcmpic(redirect_mode, "check-decoded-url") && strchr(subject, '%')) { - log_error(LOG_LEVEL_REDIRECTS, "Decoding \"%s\" if necessary.", subject); - new_url = url_decode(subject); - if (new_url != NULL) + log_error(LOG_LEVEL_REDIRECTS, + "Checking \"%s\" for encoded redirects.", subject); + + /* + * Check each parameter in the URL separately. + * Sectionize the URL at "?" and "&", + * go backwards through the segments, URL-decode them + * and look for a URL in the decoded result. + * Stop the search after the first match. + */ + char *url_segment = NULL; + /* + * XXX: This estimate is guaranteed to be high enough as we + * let ssplit() ignore empty fields, but also a bit wasteful. + */ + size_t max_segments = strlen(subject) / 2; + char **url_segments = malloc(max_segments * sizeof(char *)); + int segments; + + if (NULL == url_segments) { + log_error(LOG_LEVEL_ERROR, "Out of memory while decoding URL: %s", new_url); freez(subject); - subject = new_url; + return NULL; } - else + + segments = ssplit(subject, "?&", url_segments, max_segments, 1, 1); + + while (segments-- > 0) + { + char *dtoken = url_decode(url_segments[segments]); + if (NULL == dtoken) + { + log_error(LOG_LEVEL_ERROR, "Unable to decode \"%s\".", url_segments[segments]); + continue; + } + url_segment = strstr(dtoken, "http://"); + if (NULL == url_segment) + { + url_segment = strstr(dtoken, "https://"); + } + if (NULL != url_segment) + { + url_segment = strdup(url_segment); + freez(dtoken); + if (url_segment == NULL) + { + log_error(LOG_LEVEL_ERROR, + "Out of memory while searching for redirects."); + return NULL; + } + break; + } + freez(dtoken); + } + freez(subject); + freez(url_segments); + + if (url_segment == NULL) { - log_error(LOG_LEVEL_ERROR, "Unable to decode \"%s\".", subject); + return NULL; } + subject = url_segment; + } + else + { + /* Look for a URL inside this one, without decoding anything. */ + log_error(LOG_LEVEL_REDIRECTS, + "Checking \"%s\" for unencoded redirects.", subject); } - - log_error(LOG_LEVEL_REDIRECTS, "Checking \"%s\" for redirects.", subject); /* * Find the last URL encoded in the request @@ -1163,7 +1199,7 @@ )) { /* - * Return new URL if we found a redirect + * Return new URL if we found a redirect * or if the subject already was a URL. * * The second case makes sure that we can @@ -1269,9 +1305,24 @@ #endif /* def FEATURE_FAST_REDIRECTS */ csp->action->flags &= ~ACTION_REDIRECT; - /* Did any redirect action trigger? */ + /* Did any redirect action trigger? */ if (new_url) { + if (url_requires_percent_encoding(new_url)) + { + char *encoded_url; + log_error(LOG_LEVEL_REDIRECTS, "Percent-encoding redirect URL: %N", + strlen(new_url), new_url); + encoded_url = percent_encode_url(new_url); + freez(new_url); + if (encoded_url == NULL) + { + return cgi_error_memory(); + } + new_url = encoded_url; + assert(FALSE == url_requires_percent_encoding(new_url)); + } + if (0 == strcmpic(new_url, csp->http->url)) { log_error(LOG_LEVEL_ERROR, @@ -1289,8 +1340,8 @@ return cgi_error_memory(); } - if ( enlist_unique_header(rsp->headers, "Location", new_url) - || (NULL == (rsp->status = strdup("302 Local Redirect from Privoxy"))) ) + if (enlist_unique_header(rsp->headers, "Location", new_url) + || (NULL == (rsp->status = strdup("302 Local Redirect from Privoxy")))) { freez(new_url); free_http_response(rsp); @@ -1523,7 +1574,7 @@ struct re_filterfile_spec *b; struct list_entry *filtername; - /* + /* * Sanity first */ if (csp->iob->cur >= csp->iob->eod) @@ -1803,19 +1854,15 @@ return JB_ERR_PARSE; } - if ((newsize += chunksize) >= *size) + if (chunksize >= *size - newsize) { - /* - * XXX: The message is a bit confusing. Isn't the real problem that - * the specified chunk size is greater than the number of bytes - * left in the buffer? This probably means the connection got - * closed prematurely. To be investigated after 3.0.17 is out. - */ log_error(LOG_LEVEL_ERROR, - "Chunk size %d exceeds buffer size %d in \"chunked\" transfer coding", - chunksize, *size); + "Chunk size %u exceeds buffered data left. " + "Already digested %u of %u buffered bytes.", + chunksize, (unsigned int)newsize, (unsigned int)*size); return JB_ERR_PARSE; } + newsize += chunksize; from_p += 2; memmove(to_p, from_p, (size_t) chunksize); @@ -1828,7 +1875,7 @@ break; } } - + /* XXX: Should get its own loglevel. */ log_error(LOG_LEVEL_RE_FILTER, "De-chunking successful. Shrunk from %d to %d", *size, newsize); @@ -2207,7 +2254,7 @@ /********************************************************************* * - * Function : direct_response + * Function : direct_response * * Description : Check if Max-Forwards == 0 for an OPTIONS or TRACE * request and if so, return a HTTP 501 to the client. @@ -2216,7 +2263,7 @@ * requests properly. Still, what we do here is rfc- * compliant, whereas ignoring or forwarding are not. * - * Parameters : + * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * * Returns : http_response if , NULL if nonmatch or handler fail @@ -2232,7 +2279,7 @@ { for (p = csp->headers->first; (p != NULL) ; p = p->next) { - if (!strncmpic("Max-Forwards:", p->str, 13)) + if (!strncmpic(p->str, "Max-Forwards:", 13)) { unsigned int max_forwards; @@ -2256,7 +2303,7 @@ { return cgi_error_memory(); } - + if (NULL == (rsp->status = strdup("501 Not Implemented"))) { free_http_response(rsp); @@ -2357,7 +2404,7 @@ * Description : Checks whether there are any content filters * enabled for the current request. * - * Parameters : + * Parameters : * 1 : action = Action spec to check. * * Returns : TRUE for yes, FALSE otherwise diff -Nru privoxy-3.0.17/filters.h privoxy-3.0.19/filters.h --- privoxy-3.0.17/filters.h 2010-09-14 07:16:07.000000000 +0000 +++ privoxy-3.0.19/filters.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef FILTERS_H_INCLUDED #define FILTERS_H_INCLUDED -#define FILTERS_H_VERSION "$Id: filters.h,v 1.41 2010/09/14 07:16:07 fabiankeil Exp $" +#define FILTERS_H_VERSION "$Id: filters.h,v 1.43 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.h,v $ @@ -16,10 +16,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -89,8 +89,8 @@ */ extern void get_url_actions(struct client_state *csp, struct http_request *http); -extern void apply_url_actions(struct current_action_spec *action, - struct http_request *http, +extern void apply_url_actions(struct current_action_spec *action, + struct http_request *http, struct url_actions *b); /* * Determining parent proxies @@ -117,15 +117,7 @@ */ extern struct http_response *direct_response(struct client_state *csp); - /* - * Solaris fix: - */ -#ifndef INADDR_NONE -#define INADDR_NONE -1 -#endif - -/* * Revision control strings from this header and associated .c file */ extern const char filters_rcs[]; diff -Nru privoxy-3.0.17/gateway.c privoxy-3.0.19/gateway.c --- privoxy-3.0.17/gateway.c 2010-04-23 11:53:48.000000000 +0000 +++ privoxy-3.0.19/gateway.c 2011-12-24 15:28:45.000000000 +0000 @@ -1,4 +1,4 @@ -const char gateway_rcs[] = "$Id: gateway.c,v 1.65 2010/04/23 11:53:48 fabiankeil Exp $"; +const char gateway_rcs[] = "$Id: gateway.c,v 1.83 2011/12/24 15:28:45 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/gateway.c,v $ @@ -68,7 +68,7 @@ #include "miscutil.h" #ifdef FEATURE_CONNECTION_KEEP_ALIVE #ifdef HAVE_POLL -#ifdef __GLIBC__ +#ifdef __GLIBC__ #include #else #include @@ -88,21 +88,24 @@ int target_port, struct client_state *csp); +enum { + SOCKS4_REQUEST_GRANTED = 90, + SOCKS4_REQUEST_REJECT = 91, + SOCKS4_REQUEST_IDENT_FAILED = 92, + SOCKS4_REQUEST_IDENT_CONFLICT = 93 +}; -#define SOCKS_REQUEST_GRANTED 90 -#define SOCKS_REQUEST_REJECT 91 -#define SOCKS_REQUEST_IDENT_FAILED 92 -#define SOCKS_REQUEST_IDENT_CONFLICT 93 - -#define SOCKS5_REQUEST_GRANTED 0 -#define SOCKS5_REQUEST_FAILED 1 -#define SOCKS5_REQUEST_DENIED 2 -#define SOCKS5_REQUEST_NETWORK_UNREACHABLE 3 -#define SOCKS5_REQUEST_HOST_UNREACHABLE 4 -#define SOCKS5_REQUEST_CONNECTION_REFUSED 5 -#define SOCKS5_REQUEST_TTL_EXPIRED 6 -#define SOCKS5_REQUEST_PROTOCOL_ERROR 7 -#define SOCKS5_REQUEST_BAD_ADDRESS_TYPE 8 +enum { + SOCKS5_REQUEST_GRANTED = 0, + SOCKS5_REQUEST_FAILED = 1, + SOCKS5_REQUEST_DENIED = 2, + SOCKS5_REQUEST_NETWORK_UNREACHABLE = 3, + SOCKS5_REQUEST_HOST_UNREACHABLE = 4, + SOCKS5_REQUEST_CONNECTION_REFUSED = 5, + SOCKS5_REQUEST_TTL_EXPIRED = 6, + SOCKS5_REQUEST_PROTOCOL_ERROR = 7, + SOCKS5_REQUEST_BAD_ADDRESS_TYPE = 8 +}; /* structure of a socks client operation */ struct socks_op { @@ -335,16 +338,12 @@ sfd, reusable_connection[slot].host, reusable_connection[slot].port, slot); mark_connection_closed(&reusable_connection[slot]); - privoxy_mutex_unlock(&connection_reuse_mutex); - - return; + break; } } - log_error(LOG_LEVEL_CONNECT, - "Socket %d already forgotten or never remembered.", sfd); - privoxy_mutex_unlock(&connection_reuse_mutex); + } #endif /* def FEATURE_CONNECTION_SHARING */ @@ -383,7 +382,9 @@ && strcmpic(connection->gateway_host, fwd->gateway_host)) && (connection->gateway_host != fwd->gateway_host)) { - log_error(LOG_LEVEL_CONNECT, "Gateway mismatch."); + log_error(LOG_LEVEL_CONNECT, + "Gateway mismatch. Previous gateway: %s. Current gateway: %s", + connection->gateway_host, fwd->gateway_host); return FALSE; } @@ -392,7 +393,9 @@ && strcmpic(connection->forward_host, fwd->forward_host)) && (connection->forward_host != fwd->forward_host)) { - log_error(LOG_LEVEL_CONNECT, "Forwarding proxy mismatch."); + log_error(LOG_LEVEL_CONNECT, + "Forwarding proxy mismatch. Previous proxy: %s. Current proxy: %s", + connection->forward_host, fwd->forward_host); return FALSE; } @@ -652,7 +655,7 @@ default: /* Should never get here */ log_error(LOG_LEVEL_FATAL, - "SOCKS4 impossible internal error - bad SOCKS type."); + "Internal error in forwarded_connect(). Bad proxy type: %d", fwd->type); } if (JB_INVALID_SOCKET != sfd) @@ -721,7 +724,7 @@ if (err) { log_error(LOG_LEVEL_CONNECT, "socks4_connect: %s", errstr); - csp->error_message = strdup(errstr); + csp->error_message = strdup(errstr); errno = EINVAL; return(JB_INVALID_SOCKET); } @@ -802,12 +805,8 @@ if (sfd == JB_INVALID_SOCKET) { - /* - * XXX: connect_to should fill in the exact reason. - * Most likely resolving the IP of the forwarder failed. - */ - errstr = "connect_to failed: see logfile for details"; - err = 1; + /* The error an its reason have already been logged by connect_to() */ + return(JB_INVALID_SOCKET); } else if (write_socket(sfd, (char *)c, csiz)) { @@ -816,6 +815,20 @@ err = 1; close_socket(sfd); } + else if (!data_is_available(sfd, csp->config->socket_timeout)) + { + if (socket_is_still_alive(sfd)) + { + errstr = "SOCKS4 negotiation timed out"; + } + else + { + errstr = "SOCKS4 negotiation got aborted by the server"; + } + log_error(LOG_LEVEL_CONNECT, "socks4_connect: %s", errstr); + err = 1; + close_socket(sfd); + } else if (read_socket(sfd, buf, sizeof(buf)) != sizeof(*s)) { errstr = "SOCKS4 negotiation read failed."; @@ -826,24 +839,24 @@ if (err) { - csp->error_message = strdup(errstr); + csp->error_message = strdup(errstr); return(JB_INVALID_SOCKET); } switch (s->cd) { - case SOCKS_REQUEST_GRANTED: + case SOCKS4_REQUEST_GRANTED: return(sfd); - case SOCKS_REQUEST_REJECT: + case SOCKS4_REQUEST_REJECT: errstr = "SOCKS request rejected or failed."; errno = EINVAL; break; - case SOCKS_REQUEST_IDENT_FAILED: + case SOCKS4_REQUEST_IDENT_FAILED: errstr = "SOCKS request rejected because " "SOCKS server cannot connect to identd on the client."; errno = EACCES; break; - case SOCKS_REQUEST_IDENT_CONFLICT: + case SOCKS4_REQUEST_IDENT_CONFLICT: errstr = "SOCKS request rejected because " "the client program and identd report " "different user-ids."; @@ -930,7 +943,7 @@ { int err = 0; char cbuf[300]; - char sbuf[30]; + char sbuf[10]; size_t client_pos = 0; int server_size = 0; size_t hostlen = 0; @@ -986,6 +999,8 @@ { errstr = "socks5 server unreachable"; log_error(LOG_LEVEL_CONNECT, "socks5_connect: %s", errstr); + /* Free the generic error message provided by connect_to() */ + freez(csp->error_message); csp->error_message = strdup(errstr); return(JB_INVALID_SOCKET); } @@ -1004,7 +1019,20 @@ return(JB_INVALID_SOCKET); } - if (read_socket(sfd, sbuf, sizeof(sbuf)) != 2) + if (!data_is_available(sfd, csp->config->socket_timeout)) + { + if (socket_is_still_alive(sfd)) + { + errstr = "SOCKS5 negotiation timed out"; + } + else + { + errstr = "SOCKS5 negotiation got aborted by the server"; + } + err = 1; + } + + if (!err && read_socket(sfd, sbuf, sizeof(sbuf)) != 2) { errstr = "SOCKS5 negotiation read failed"; err = 1; @@ -1053,7 +1081,7 @@ if (write_socket(sfd, cbuf, client_pos)) { - errstr = "SOCKS5 negotiation read failed"; + errstr = "SOCKS5 negotiation write failed"; csp->error_message = strdup(errstr); log_error(LOG_LEVEL_CONNECT, "%s", errstr); close_socket(sfd); @@ -1062,43 +1090,33 @@ } server_size = read_socket(sfd, sbuf, sizeof(sbuf)); - if (server_size < 3) + if (server_size != sizeof(sbuf)) { errstr = "SOCKS5 negotiation read failed"; - err = 1; - } - else if (server_size > 20) - { - /* This is somewhat unexpected but doesn't realy matter. */ - log_error(LOG_LEVEL_CONNECT, "socks5_connect: read %d bytes " - "from socks server. Would have accepted up to %d.", - server_size, sizeof(sbuf)); - } - - if (!err && (sbuf[0] != '\x05')) - { - errstr = "SOCKS5 negotiation protocol version error"; - err = 1; } - - if (!err && (sbuf[2] != '\x00')) - { - errstr = "SOCKS5 negotiation protocol error"; - err = 1; - } - - if (!err) + else { - if (sbuf[1] == SOCKS5_REQUEST_GRANTED) + if (sbuf[0] != '\x05') + { + errstr = "SOCKS5 negotiation protocol version error"; + } + else if (sbuf[2] != '\x00') + { + errstr = "SOCKS5 negotiation protocol error"; + } + else if (sbuf[1] != SOCKS5_REQUEST_GRANTED) + { + errstr = translate_socks5_error(sbuf[1]); + } + else { return(sfd); } - errstr = translate_socks5_error(sbuf[1]); } assert(errstr != NULL); csp->error_message = strdup(errstr); - log_error(LOG_LEVEL_CONNECT, "socks5_connect: %s", errstr); + log_error(LOG_LEVEL_CONNECT, "socks5_connect: %s: %N", errstr, server_size, sbuf); close_socket(sfd); errno = EINVAL; diff -Nru privoxy-3.0.17/gateway.h privoxy-3.0.19/gateway.h --- privoxy-3.0.17/gateway.h 2009-10-03 10:37:49.000000000 +0000 +++ privoxy-3.0.19/gateway.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef GATEWAY_H_INCLUDED #define GATEWAY_H_INCLUDED -#define GATEWAY_H_VERSION "$Id: gateway.h,v 1.19 2009/10/03 10:37:49 fabiankeil Exp $" +#define GATEWAY_H_VERSION "$Id: gateway.h,v 1.21 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/gateway.h,v $ @@ -13,10 +13,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -45,8 +45,8 @@ struct http_request; struct client_state; -extern jb_socket forwarded_connect(const struct forward_spec * fwd, - struct http_request *http, +extern jb_socket forwarded_connect(const struct forward_spec * fwd, + struct http_request *http, struct client_state *csp); /* @@ -71,13 +71,6 @@ #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ /* - * Solaris fix - */ -#ifndef INADDR_NONE -#define INADDR_NONE -1 -#endif - -/* * Revision control strings from this header and associated .c file */ extern const char gateway_rcs[]; diff -Nru privoxy-3.0.17/GNUmakefile.in privoxy-3.0.19/GNUmakefile.in --- privoxy-3.0.17/GNUmakefile.in 2010-02-20 12:53:30.000000000 +0000 +++ privoxy-3.0.19/GNUmakefile.in 2011-11-20 17:17:56.000000000 +0000 @@ -1,15 +1,15 @@ # Note: Makefile is built automatically from Makefile.in # -# $Id: GNUmakefile.in,v 1.189 2010/02/20 12:53:30 fabiankeil Exp $ +# $Id: GNUmakefile.in,v 1.205 2011/11/20 17:17:56 fabiankeil Exp $ # -# Written by and Copyright (C) 2001-2010 members of the +# Written by and Copyright (C) 2001-2011 members of the # Privoxy team. http://www.privoxy.org/ # # Based on the Internet Junkbuster originally written -# by and Copyright (C) 1997 Anonymous Coders and +# by and Copyright (C) 1997 Anonymous Coders and # Junkbusters Corporation. http://www.junkbusters.com # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -60,21 +60,22 @@ SBIN_DEST = @sbindir@ MAN_DIR = @mandir@ MAN_DEST = $(MAN_DIR)/man1 +MAN_PAGE = privoxy.1 SHARE_DEST = @datadir@ DOC_DEST = $(SHARE_DEST)/doc/privoxy VAR_DEST = @localstatedir@ LOGS_DEST = $(VAR_DEST)/log/privoxy PIDS_DEST = $(VAR_DEST)/run -# if $prefix = /usr/local then the default CONFDEST change from -# CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy +# if $prefix = /usr/local then the default CONFDEST change from +# CONF_DEST = $(CONF_BASE) to CONF_DEST = $(CONF_BASE)/privoxy # by the target rule CONF_DEST # # also if the $prefix is /usr/local and there is no # $(SHARE_DEST)/doc, it checks for $prefix/doc and installs there # instead in this situation # -# finally if $prefix=/usr/local and VAR_DEST=$prefix/var it +# finally if $prefix=/usr/local and VAR_DEST=$prefix/var it # changes this to /var for storing the logs and pidfile # used in source dir only, the install goes to $share_dest/doc/privoxy @@ -90,13 +91,13 @@ DIR_MODE = 0755 # Files daemon writes to. RWD_MODE = 0660 -INSTALL_P = -m $(BIN_MODE) +INSTALL_P = -m $(BIN_MODE) INSTALL_T = -m $(RA_MODE) INSTALL_D = -m $(DIR_MODE) -d INSTALL_R = -m $(RWD_MODE) # install options for superuser install -#INSTALL_S = -g @GROUP@ -o @USER@ +#INSTALL_S = -g @GROUP@ -o @USER@ ############################################################################# # Build tools @@ -141,6 +142,7 @@ DOC_DIR = doc/source DOC_TMP = $(DOC_DIR)/tmp DOC_STATUS = @DOC_STATUS@ +TIDY = tidy -modify -indent -clean -wrap 78 # Program to do LF->CRLF # @@ -155,6 +157,7 @@ # If your SF user name differs from your local one, # change this to "ssh -l sf-username" SSH = ssh +WWW_ROOT = /home/project-web/ijbswa ############################################################################# # Setup for make distribution for now. @@ -175,7 +178,7 @@ DOC_FILES = AUTHORS LICENSE README ChangeLog INSTALL \ `find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \ `find doc/webserver/ -name "*.css"` \ - privoxy.1 + $(MAN_PAGE) ############################################################################# # Filenames and libraries @@ -237,11 +240,11 @@ # possibly other OSs). SPECIAL_CFLAGS = @SPECIAL_CFLAGS@ -# Add your flags here -OTHER_CFLAGS = +# Add your flags here +OTHER_CFLAGS = CFLAGS = @CFLAGS@ @CPPFLAGS@ $(OTHER_CFLAGS) $(SPECIAL_CFLAGS) -Wall \ - @STATIC_PCRE_ONLY@ -Ipcre + @STATIC_PCRE_ONLY@ -Ipcre LDFLAGS = @LDFLAGS@ $(DEBUG_CFLAGS) $(SPECIAL_CFLAGS) @@ -273,8 +276,7 @@ # Strip master copy comments from default.action: ############################################################################# default.action: default.action.master - $(GREP) -v '^#MASTER#' $< > $@ - + $(GREP) -v '^#MASTER#' default.action.master > $@ ############################################################################# # Win32 config files ############################################################################# @@ -293,7 +295,7 @@ $(DOSFILTER) default.filter.txt && mv default.filter.txt default.filter trust.txt: trust - $(DOSFILTER) < $< > $@ + $(DOSFILTER) < $< > $@ ############################################################################# # Pre-dist check: @@ -321,9 +323,9 @@ ############################################################################# # create tar.gz from CVS: -# This make-target is usually called through 'create-archive'. If you +# This make-target is usually called through 'create-archive'. If you # run 'make create-snapshot' without setting SNAPVERSION, you'll get a -# tar.gz with the current date in the name and as a releasenumber in the +# tar.gz with the current date in the name and as a releasenumber in the # spec-file. But the main usage is to run it as follows (Red Hat example): # make SNAPVERSION=1.6x create-snapshot # This creates a tar.gz. @@ -343,7 +345,7 @@ ############################################################################# # looks at the version of Makefile and exports a corresponding source-tree -# example: if the Makefile has the sticky tag v_2_9_13, you'll get +# example: if the Makefile has the sticky tag v_2_9_13, you'll get # privoxy-*-2.4.13.tar.gz. ############################################################################# create-archive: @@ -364,7 +366,7 @@ # add config files for foo in $(CONFIG_FILES); do \ (cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \ - done; + done; # add documentation for foo in $(DOC_FILES); do \ (cd .. && $(TAR) -uvhf --exclude "PACKAGERS" privoxy-$(TARGET_OS)-$(VERSION)-$(CODE_STATUS)-src.tar privoxy-$(VERSION)-$(CODE_STATUS)/$$foo;) \ @@ -403,7 +405,7 @@ cd .. && $(TAR) -cvhf privoxy-$(VERSION)-$(CODE_STATUS)-src.tar $$files ; \ # and zip the archive - $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS) + $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS) $(GZIP_PROG) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar @$(ECHO) Tarball distribution created. @@ -428,14 +430,14 @@ ############################################################################# # developer manual -dok-devel: +dok-devel: $(RM) doc/webserver/developer-manual/*.html $(RM) -r doc/source/developer-manual mkdir -p doc/source/developer-manual cd doc/source/developer-manual && $(DB) ../developer-manual.sgml && cd .. && cp developer-manual/*.html ../webserver/developer-manual/ # user manual -dok-user: +dok-user: $(RM) doc/webserver/user-manual/*.html $(RM) -r doc/source/user-manual/ mkdir -p doc/source/user-manual @@ -446,58 +448,56 @@ $(PERL) -pi.bak -e 's/<\/head/\n\n<\/head/i' doc/webserver/user-manual/*html # faq -dok-faq: +dok-faq: $(RM) doc/webserver/faq/*.html $(RM) -r doc/source/faq mkdir -p doc/source/faq cd doc/source/faq && $(DB) ../faq.sgml && cd .. && cp faq/*.html ../webserver/faq/ -# man page, one variation. Try to use the next target, just 'make man'. -dok-man: +# man page, one variation. Try to use the next target, just 'make man'. +dok-man: $(RM) doc/man/* doc/webserver/man-page/*.html -ifneq ($(MAN2HTML),false) - $(ECHO) "Privoxy Man page

NAME

" > doc/webserver/man-page/privoxy-man-page.html - man ./privoxy.1 | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html - $(ECHO) "" >> doc/webserver/man-page/privoxy-man-page.html -else - $(MAKE) groff2html -endif + echo MAN2HTML is $(MAN2HTML) + @if [ $(MAN2HTML) != "false" ]; then \ + $(ECHO) "Privoxy Man page

NAME

" > doc/webserver/man-page/privoxy-man-page.html; \ + man ./$(MAN_PAGE) | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html; \ + $(ECHO) "" >> doc/webserver/man-page/privoxy-man-page.html; \ + else \ + $(MAKE) groff2html; \ + fi; # Build man page from sgml. This requires the SGMLSpm perl module. -# See CPAN, or your favorite perl repository. This is the preferred +# See CPAN, or your favorite perl repository. This is the preferred # target for man page generation! man: dok-release mkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\ nsgmls ../privoxy-man-page.sgml | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\ - perl -pi.bak -e 's/ //; s/\[ /\[/g' privoxy.1 ;\ - perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" privoxy.1; \ - perl -pi.bak -e "s/ö/\\\\[:o]/g" privoxy.1; \ - perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' privoxy.1; \ - perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' privoxy.1; \ - perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' privoxy.1; \ - $(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.1 ../../../privoxy.1 + perl -pi.bak -e 's/ //; s/\[ /\[/g' $(MAN_PAGE) ;\ + perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" $(MAN_PAGE); \ + perl -pi.bak -e "s/ö/\\\\[:o]/g" $(MAN_PAGE); \ + perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' $(MAN_PAGE); \ + perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' $(MAN_PAGE); \ + perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' $(MAN_PAGE); \ + $(DB) ../privoxy-man-page.sgml && $(MV) -f $(MAN_PAGE) ../../../$(MAN_PAGE) # For those with man2html ala RH7s. man2html: mkdir -p doc/webserver/man-page -ifneq ($(MAN2HTML),false) - $(MAN2HTML) privoxy.1 |grep -v "^Content-type" > tmp.html - $(PERL) -pi.bak -e 's///; s//man2html/' tmp.html - $(PERL) -pi.bak -e 's/(<\/HEAD>)/<\/HEAD>/' tmp.html -# Twice because my version of man2html is pulling in commas and periods in URLs. - $(PERL) -pi.bak -e 's/()/$$1$$2/g' tmp.html - $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html - $(PERL) -pi.bak -e "s/\['a\]/\á/g;s/\['e\]/\é/g" tmp.html -# Get rid of spurious  from conversion. (How to do this with perl?) - $(SED) -e 's///g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.* -else - $(MAKE) groff2html -endif - + @if [ $(MAN2HTML) != "false" ]; then \ + $(MAN2HTML) $(MAN_PAGE) |grep -v "^Content-type" > tmp.html; \ + $(PERL) -pi.bak -e 's///; s//man2html/' tmp.html; \ + $(PERL) -pi.bak -e 's/(<\/HEAD>)/<\/HEAD>/' tmp.html; \ + $(PERL) -pi.bak -e 's/()/$$1$$2/g' tmp.html; \ + $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html; \ + $(PERL) -pi.bak -e "s/\['a\]/\á/g;s/\['e\]/\é/g" tmp.html; \ + $(SED) -e 's///g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.*; \ + else \ + $(MAKE) groff2html; \ + fi; # Otherwise we get plain groff conversion. groff2html: - $(G2H_CMD) ./privoxy.1 | $(SED) -e 's@@@' > doc/webserver/man-page/privoxy-man-page.html + $(G2H_CMD) ./$(MAN_PAGE) | $(SED) -e 's@@@' > doc/webserver/man-page/privoxy-man-page.html # readme page and INSTALL file @@ -512,7 +512,7 @@ # for documentation, etc. # # index.html for webserver: -dok-webserver: +dok-webserver: cd doc/source/webserver && $(DB)-notoc -ip-homepage -V nochunks index.sgml > ../../webserver/index.html $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\ s/<\/HEAD/\n<\/HEAD/;\ @@ -522,7 +522,7 @@ doc/webserver/index.html && $(RM) doc/webserver/*.bak # privoxy-index.html for local documentation: -dok-index: +dok-index: cd doc/source/webserver && $(DB)-notoc -ip-index -V nochunks index.sgml > ../../webserver/privoxy-index.html $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\ s/<\/HEAD/\n<\/HEAD/;\ @@ -536,7 +536,7 @@ @$(ECHO) Documentation created. ## Make AUTHORS file -dok-authors: +dok-authors: cd doc/source && $(DB) -V nochunks authors.sgml > tmp.html && env -u LANG $(WDUMP) \ tmp.html > ../../AUTHORS && $(RM) tmp.html @@ -548,19 +548,18 @@ s///' \ doc/source/*sgml doc/source/*/*sgml $(RM) -r doc/source/*bak doc/source/*/*bak -ifeq ($(CODE_STATUS),stable) - @$(ECHO) Setting docs to stable $(VERSION) - @$(PERL) -pi.bak -e 's///;\ - s///' \ - doc/source/*sgml doc/source/*/*sgml - $(RM) -r doc/source/*bak doc/source/*/*bak -else - @$(ECHO) Setting docs to not stable $(VERSION) - @$(PERL) -pi.bak -e 's///;\ - s///' \ - doc/source/*sgml doc/source/*/*sgml - $(RM) -r doc/source/*bak doc/source/*/*bak -endif + @if [ $(CODE_STATUS) = "stable" ]; then \ + $(ECHO) Setting docs to stable $(VERSION); \ + $(PERL) -pi.bak -e 's///;\ + s///' \ + doc/source/*sgml doc/source/*/*sgml; \ + else \ + $(ECHO) Setting docs to not stable $(VERSION); \ + $(PERL) -pi.bak -e 's///; \ + s///' \ + doc/source/*sgml doc/source/*/*sgml; \ + fi; + $(RM) -r doc/source/*bak doc/source/*/*bak; # Create release announcement in text and html, with short and long versions. # This is a standalone target, and must be invoked directly. @@ -570,13 +569,13 @@ # mv -f index.html announce.html && $(WDUMP) announce.html > announce.txt # cd $(DOC_TMP) && $(DB) announce.sgml &&\ # mv -f index.html announce-mini.html && $(WDUMP) announce-mini.html > announce-mini.txt &&\ -# mv -f *html *txt ../../.. +# mv -f *html *txt ../../.. # rm -fr $(DOC_TMP) -# The main Privoxy config file, generated from sgml sources. -# NOTE: This will require some hand editing. The new file is outputted +# The main Privoxy config file, generated from sgml sources. +# NOTE: This will require some hand editing. The new file is outputted # as config.new so that problem sections can be compared to previous -# version. This is hardcored to w3m for html/text conversion. Also, +# version. This is hardcored to w3m for html/text conversion. Also, # requires the shell util 'fmt'. config-file: dok-release cd doc/source && $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\ @@ -595,7 +594,7 @@ # config file, alternate version using lynx (perl stuff unfinished). Lynx # does not do so good a job. -config-file-alt: +config-file-alt: cd doc/source && $(ECHO) -e ".h2 JUSTIFY\\nJUSTIFY:FALSE" > __tmp.lynx_cfg &&\ $(DB)-notoc -iconfig-file -V nochunks config.sgml > __tmp.html &&\ lynx -cfg=__tmp.lynx_cfg -width=78 -dump __tmp.html > ../../config.new && $(RM) -r __tmp.* @@ -609,44 +608,50 @@ # moves dokumentation to webserver # ############################################################################# -webserver: tidy +webserver: clean-editor-files @$(ECHO) ------------------------------------------------------- @$(ECHO) You will need to "create" a SF shell first: - @$(ECHO) ssh -t USER,PROJECT@shell.sourceforge.net create + @$(ECHO) ssh -t SF-USER-ID,ijbswa@shell.sourceforge.net create @$(ECHO) Please make sure your documentation files are up to date. - @$(ECHO) Note that this command updates the home page and scps + @$(ECHO) Note that this command updates the home page and copys @$(ECHO) all stuff to the webserver, it will not remove obsolete documents. - @$(ECHO) You will also need to change the user-manual symlink manually. + @$(ECHO) Note that a botched upload can result in the documentation + @$(ECHO) on the website becoming unreachable! Also the CSS files + @$(ECHO) currently seem to end up at the wrong place. @$(ECHO) ------------------------------------------------------- + @$(ECHO) Replacing the user-manual symlink + @$(SSH) shell.sourceforge.net "cd $(WWW_ROOT)/htdocs && rm user-manual \ + && mkdir -p $(VERSION)/user-manual && ln -s $(VERSION)/user-manual user-manual" + @$(ECHO) Uploading html @cd doc/webserver; \ upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \ - $(TAR) cf - $$upload | ssh shell.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/; tar xvm 2>&1 | grep -v timestamp' + $(TAR) cf - $$upload | $(SSH) shell.sourceforge.net 'cd $(WWW_ROOT)/htdocs/; tar xvm 2>&1 | grep -v timestamp' @$(ECHO) Fixing permissions - @$(SSH) shell.sourceforge.net 'chmod -R 775 /home/groups/i/ij/ijbswa/htdocs 2>/dev/null; true' - @$(SSH) shell.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/ -type f | xargs chmod 664 2>/dev/null; true' + @$(SSH) shell.sourceforge.net 'chmod -R 775 $(WWW_ROOT)/htdocs 2>/dev/null; true' + @$(SSH) shell.sourceforge.net 'find $(WWW_ROOT)/htdocs/ -type f | xargs chmod 664 2>/dev/null; true' -web-actions: tidy - @$(ECHO) Uploading +web-actions: clean-editor-files + @$(ECHO) Uploading @cd doc/webserver/actions; \ upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \ - $(TAR) cf - $$upload | ssh ijbswa.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/actions; tar xvm' + $(TAR) cf - $$upload | $(SSH) ijbswa.sourceforge.net 'cd $(WWW_ROOT)/htdocs/actions; tar xvm' @$(ECHO) Fixing permissions - @$(SSH) ijbswa.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null' - @$(SSH) ijbswa.sourceforge.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null' + @$(SSH) ijbswa.sourceforge.net 'find $(WWW_ROOT)/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null' + @$(SSH) ijbswa.sourceforge.net 'chmod 666 $(WWW_ROOT)/htdocs/actions/results/actions-feedback.txt 2>/dev/null' -## +## dok-put: tar --exclude ".cvsignore" --exclude "CVS" --exclude "source" --exclude ".htaccess" \ --exclude "obsolete" --exclude "actions" --exclude "*.zip" --exclude "robots.txt"\ doc/* INSTALL LICENSE AUTHORS README \ -czf $(DOC_FILE) ;\ $(ECHO) "Uploading doc package ..." ;\ - scp $(DOC_FILE) ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/docs/ - @$(SSH) ijbswa.sourceforge.net 'chmod 775 /home/groups/i/ij/ijbswa/htdocs/docs/*gz 2>/dev/null; true' + scp $(DOC_FILE) ijbswa.sourceforge.net:$(WWW_ROOT)/htdocs/docs/ + @$(SSH) ijbswa.sourceforge.net 'chmod 775 $(WWW_ROOT)/htdocs/docs/*gz 2>/dev/null; true' $(RM) $(DOC_FILE) dok-get: @@ -654,6 +659,22 @@ $(WGET) http://www.privoxy.org/docs/$(DOC_FILE) ;\ $(TAR) -zxvf $(DOC_FILE) +############################################################################# +# +# Try to clean up the generated HTML files. +# +# The files are a such a mess that some of them require two tidy runs +# in row as the first abort prematurely. The vanilla tidy output renders +# poorly as it contains a bit too much white-space, so we additionally run +# the files through perl to fix this again. +# +############################################################################# +dok-tidy: + for html_file in `find doc/webserver -name "*.html"`; do \ + $(TIDY) $$html_file || $(TIDY) $$html_file; \ + $(PERL) -i'' -e 's@^\s*
\s*$$@@; s@ +$$@@;' -n -p $$html_file; \ + done + ############################################################################# # Source file dependencies @@ -666,7 +687,7 @@ deanimate.@OBJEXT@: deanimate.c deanimate.h config.h $(PROJECT_H_DEPS) encode.@OBJEXT@: encode.c encode.h config.h errlog.@OBJEXT@: errlog.c errlog.h config.h $(PROJECT_H_DEPS) @WIN_ONLY@w32log.h -filters.@OBJEXT@: filters.c filters.h config.h $(PROJECT_H_DEPS) errlog.h encode.h gateway.h jbsockets.h jcc.h loadcfg.h parsers.h ssplit.h cgi.h deanimate.h urlmatch.h @WIN_ONLY@win32.h +filters.@OBJEXT@: filters.c filters.h config.h $(PROJECT_H_DEPS) errlog.h encode.h gateway.h jbsockets.h jcc.h loadcfg.h parsers.h ssplit.h cgi.h deanimate.h urlmatch.h @WIN_ONLY@win32.h gateway.@OBJEXT@: gateway.c gateway.h config.h $(PROJECT_H_DEPS) errlog.h jbsockets.h jcc.h loadcfg.h jbsockets.@OBJEXT@: jbsockets.c jbsockets.h config.h $(PROJECT_H_DEPS) filters.h jcc.@OBJEXT@: jcc.c jcc.h config.h $(PROJECT_H_DEPS) errlog.h filters.h gateway.h jbsockets.h loadcfg.h loaders.h miscutil.h parsers.h @WIN_ONLY@w32log.h win32.h w32svrapi.h cgi.h @@ -682,12 +703,12 @@ gnu_regex.@OBJEXT@: gnu_regex.c gnu_regex.h config.h # PCRS -pcrs.@OBJEXT@: pcrs.c pcrs.h config.h @STATIC_PCRE_ONLY@pcre/pcre.h +pcrs.@OBJEXT@: pcrs.c pcrs.h config.h @STATIC_PCRE_ONLY@pcre/pcre.h # PCRE pcre/get.@OBJEXT@: pcre/get.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/maketables.@OBJEXT@: pcre/maketables.c pcre/config.h pcre/internal.h pcre/pcre.h -pcre/pcre.@OBJEXT@: pcre/pcre.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c +pcre/pcre.@OBJEXT@: pcre/pcre.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/chartables.c pcre/pcreposix.@OBJEXT@: pcre/pcreposix.c pcre/config.h pcre/internal.h pcre/pcre.h pcre/pcreposix.h pcre/study.@OBJEXT@: pcre/study.c pcre/config.h pcre/internal.h pcre/pcre.h @@ -726,20 +747,20 @@ $(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action \ `find . -name TAGS -o -name tags | $(GREP) -v .git` config.base config.tmp -tidy: +clean-editor-files: $(RM) `find . -name "*~"` $(RM) `find . -name "#*#"` # Emacs backup files $(RM) `find . -name ".\#*"` -clobber: tidy +clobber: clean-editor-files $(RM) GNUmakefile configure config.h.in config.h config.cache config.status config.log logfile \ privoxy.log core *.tar.gz *.tar privoxy-cl.spec doc/source/ldp.dsl config.new $(RM) -r autom4te.cache # -# FIXME: What is all this? +# FIXME: What is all this? # - $(RM) cscope.* *.pdb *.lib *.exp + $(RM) cscope.* *.pdb *.lib *.exp distclean: clobber @@ -780,11 +801,11 @@ install-strip: $(MAKE) install STRIP=-s -# FIXME: Test USER and GROUP on Slack to make sure this works as +# FIXME: Test USER and GROUP on Slack to make sure this works as # intended. # -# FIXME: id handling needs help, probably via configure, since 'id -u' is not -# universally reliable (eg Solaris). Group handling could be better. +# FIXME: id handling needs help, probably via configure, since 'id -u' is not +# universally reliable (eg Solaris). Group handling could be better. # Perhaps the whole user/group validation should be done here, and simplified. PROGRAM_V = Privoxy $(VERSION) $(CODE_STATUS) install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T @@ -792,7 +813,7 @@ @if [ -n "$(USER)" ]; then \ $(ID) $(USER) >/dev/null || exit 1;\ fi - @# Test for valid group. FIXME. USER does not have to belong to GROUP + @# Test for valid group. FIXME. USER does not have to belong to GROUP @# for file ownership purposes. # if [ -n "$(GROUP_T)" ] && [ -n "$(USER)" ] && ! $(GROUPS) $(USER) | $(GREP) "\<$(GROUP_T)\>" >/dev/null; then \ # $(ECHO) Group $(GROUP_T) for User $(USER) is invalid && exit 1 ;\ @@ -838,8 +859,8 @@ $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC/user-manual;\ fi @# Not all platforms support gzipped man pages. - @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/privoxy.1 - -$(INSTALL) $(INSTALL_T) privoxy.1 $(DESTDIR)$(MAN_DEST)/privoxy.1 + @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE) + -$(INSTALL) $(INSTALL_T) $(MAN_PAGE) $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE) @# Change the config file default directories according to the configured ones @$(ECHO) Rewriting config for this installation @@ -855,10 +876,10 @@ $(SED) 's+^#\?user-manual .*+user-manual $(prefix)/doc/privoxy/user-manual/+' config.tmp >config.updated ;\ fi;\ $(MV) config config.base - $(MV) config.updated config + $(MV) config.updated config - @# Install the config support files. Test for root install, and abort - @# if there is no privoxy user, and no other user was enabled during + @# Install the config support files. Test for root install, and abort + @# if there is no privoxy user, and no other user was enabled during @# configure. Later, install init script if appropriate. @$(ECHO) Installing templates to $(DESTDIR)$(CONF_DEST)/templates @for i in `find templates -type f`; do \ @@ -987,7 +1008,7 @@ @# man page and docs @$(ECHO) Removing $(PROGRAM) docs - -$(RM) $(DESTDIR)$(MAN_DEST)/privoxy.1* + -$(RM) $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE)* -$(RM) -r $(DESTDIR)$(DOC_DEST) || $(RM) -r $(DESTDIR)$(prefix)/doc/privoxy @# Log and pidfile diff -Nru privoxy-3.0.17/INSTALL privoxy-3.0.19/INSTALL --- privoxy-3.0.17/INSTALL 2010-11-10 21:52:21.000000000 +0000 +++ privoxy-3.0.19/INSTALL 2011-12-26 17:04:33.000000000 +0000 @@ -8,10 +8,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -26,8 +26,8 @@ * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * or write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA * *********************************************************************/ @@ -40,8 +40,8 @@ When building from a source tarball, first unpack the source: - tar xzvf privoxy-3.0.17-stable-src.tar.gz - cd privoxy-3.0.17-stable + tar xzvf privoxy-3.0.19-stable-src.tar.gz + cd privoxy-3.0.19-stable For retrieving the current CVS sources, you'll need a CVS client installed. Note that sources from CVS are typically development quality, and may not be diff -Nru privoxy-3.0.17/jbsockets.c privoxy-3.0.19/jbsockets.c --- privoxy-3.0.17/jbsockets.c 2010-07-26 11:30:09.000000000 +0000 +++ privoxy-3.0.19/jbsockets.c 2011-12-10 17:26:30.000000000 +0000 @@ -1,4 +1,4 @@ -const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.79 2010/07/26 11:30:09 fabiankeil Exp $"; +const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.111 2011/12/10 17:26:30 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ @@ -8,14 +8,14 @@ * OS-independent. Contains #ifdefs to make this work * on many platforms. * - * Copyright : Written by and Copyright (C) 2001-2010 the + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -118,6 +118,11 @@ #define MAX_LISTEN_BACKLOG 128 +#ifdef HAVE_RFC2553 +static jb_socket rfc2553_connect_to(const char *host, int portnum, struct client_state *csp); +#else +static jb_socket no_rfc2553_connect_to(const char *host, int portnum, struct client_state *csp); +#endif /********************************************************************* * @@ -130,37 +135,83 @@ * 1 : host = hostname to connect to * 2 : portnum = port to connent on (XXX: should be unsigned) * 3 : csp = Current client state (buffers, headers, etc...) - * Not modified, only used for source IP and ACL. * * Returns : JB_INVALID_SOCKET => failure, else it is the socket * file descriptor. * *********************************************************************/ +jb_socket connect_to(const char *host, int portnum, struct client_state *csp) +{ + jb_socket fd; + int forwarded_connect_retries = 0; + + do + { + /* + * XXX: The whole errno overloading is ridiculous and should + * be replaced with something sane and thread safe + */ + /* errno = 0;*/ +#ifdef HAVE_RFC2553 + fd = rfc2553_connect_to(host, portnum, csp); +#else + fd = no_rfc2553_connect_to(host, portnum, csp); +#endif + if ((fd != JB_INVALID_SOCKET) || (errno == EINVAL) + || (csp->fwd == NULL) + || ((csp->fwd->forward_host == NULL) && (csp->fwd->type == SOCKS_NONE))) + { + break; + } + forwarded_connect_retries++; + if (csp->config->forwarded_connect_retries != 0) + { + log_error(LOG_LEVEL_ERROR, + "Attempt %d of %d to connect to %s failed. Trying again.", + forwarded_connect_retries, csp->config->forwarded_connect_retries + 1, host); + } + + } while (forwarded_connect_retries < csp->config->forwarded_connect_retries); + + return fd; +} + #ifdef HAVE_RFC2553 /* Getaddrinfo implementation */ -jb_socket connect_to(const char *host, int portnum, struct client_state *csp) +static jb_socket rfc2553_connect_to(const char *host, int portnum, struct client_state *csp) { struct addrinfo hints, *result, *rp; char service[6]; int retval; jb_socket fd; fd_set wfds; - struct timeval tv[1]; + struct timeval timeout; #if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) int flags; #endif int connect_failed; + /* + * XXX: Initializeing it here is only necessary + * because not all situations are properly + * covered yet. + */ + int socket_error = 0; #ifdef FEATURE_ACL struct access_control_addr dst[1]; #endif /* def FEATURE_ACL */ + /* Don't leak memory when retrying. */ + freez(csp->error_message); + freez(csp->http->host_ip_addr_str); + retval = snprintf(service, sizeof(service), "%d", portnum); if ((-1 == retval) || (sizeof(service) <= retval)) { log_error(LOG_LEVEL_ERROR, "Port number (%d) ASCII decimal representation doesn't fit into 6 bytes", portnum); + csp->error_message = strdup("Invalid port number"); csp->http->host_ip_addr_str = strdup("unknown"); return(JB_INVALID_SOCKET); } @@ -178,10 +229,20 @@ "Can not resolve %s: %s", host, gai_strerror(retval)); /* XXX: Should find a better way to propagate this error. */ errno = EINVAL; + csp->error_message = strdup(gai_strerror(retval)); csp->http->host_ip_addr_str = strdup("unknown"); return(JB_INVALID_SOCKET); } + csp->http->host_ip_addr_str = malloc(NI_MAXHOST); + if (NULL == csp->http->host_ip_addr_str) + { + freeaddrinfo(result); + log_error(LOG_LEVEL_ERROR, + "Out of memory while getting the server IP address."); + return JB_INVALID_SOCKET; + } + for (rp = result; rp != NULL; rp = rp->ai_next) { @@ -191,38 +252,29 @@ if (block_acl(dst, csp)) { #ifdef __OS2__ - errno = SOCEPERM; + socket_error = errno = SOCEPERM; #else - errno = EPERM; + socket_error = errno = EPERM; #endif continue; } #endif /* def FEATURE_ACL */ - csp->http->host_ip_addr_str = malloc(NI_MAXHOST); - if (NULL == csp->http->host_ip_addr_str) - { - log_error(LOG_LEVEL_ERROR, - "Out of memory while getting the server IP address."); - return JB_INVALID_SOCKET; - } retval = getnameinfo(rp->ai_addr, rp->ai_addrlen, csp->http->host_ip_addr_str, NI_MAXHOST, NULL, 0, NI_NUMERICHOST); - if (!csp->http->host_ip_addr_str || retval) + if (retval) { log_error(LOG_LEVEL_ERROR, - "Can not save csp->http->host_ip_addr_str: %s", - (csp->http->host_ip_addr_str) ? - gai_strerror(retval) : "Insufficient memory"); - freez(csp->http->host_ip_addr_str); + "Failed to get the host name from the socket structure: %s", + gai_strerror(retval)); continue; } + fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); #ifdef _WIN32 - if ((fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) == - JB_INVALID_SOCKET) + if (fd == JB_INVALID_SOCKET) #else - if ((fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) < 0) + if (fd < 0) #endif { continue; @@ -246,10 +298,12 @@ connect_failed = 0; while (connect(fd, rp->ai_addr, rp->ai_addrlen) == JB_INVALID_SOCKET) { +#ifdef __OS2__ + errno = sock_errno(); +#endif /* __OS2__ */ + #ifdef _WIN32 if (errno == WSAEINPROGRESS) -#elif __OS2__ - if (sock_errno() == EINPROGRESS) #else /* ifndef _WIN32 */ if (errno == EINPROGRESS) #endif /* ndef _WIN32 || __OS2__ */ @@ -257,12 +311,9 @@ break; } -#ifdef __OS2__ - if (sock_errno() != EINTR) -#else if (errno != EINTR) -#endif /* __OS2__ */ { + socket_error = errno; close_socket(fd); connect_failed = 1; break; @@ -285,31 +336,36 @@ FD_ZERO(&wfds); FD_SET(fd, &wfds); - tv->tv_sec = 30; - tv->tv_usec = 0; + memset(&timeout, 0, sizeof(timeout)); + timeout.tv_sec = 30; - /* MS Windows uses int, not SOCKET, for the 1st arg of select(). Wierd! */ - if ((select((int)fd + 1, NULL, &wfds, NULL, tv) > 0) + /* MS Windows uses int, not SOCKET, for the 1st arg of select(). Weird! */ + if ((select((int)fd + 1, NULL, &wfds, NULL, &timeout) > 0) && FD_ISSET(fd, &wfds)) { - /* - * See Linux connect(2) man page for more info - * about connecting on non-blocking socket. - */ - int socket_in_error; - socklen_t optlen = sizeof(socket_in_error); - if (!getsockopt(fd, SOL_SOCKET, SO_ERROR, &socket_in_error, &optlen)) + socklen_t optlen = sizeof(socket_error); + if (!getsockopt(fd, SOL_SOCKET, SO_ERROR, &socket_error, &optlen)) { - if (!socket_in_error) + if (!socket_error) { /* Connection established, no need to try other addresses. */ break; } - log_error(LOG_LEVEL_CONNECT, "Could not connect to [%s]:%s: %s.", - csp->http->host_ip_addr_str, service, strerror(socket_in_error)); + if (rp->ai_next != NULL) + { + /* + * There's another address we can try, so log that this + * one didn't work out. If the last one fails, too, + * it will get logged outside the loop body so we don't + * have to mention it here. + */ + log_error(LOG_LEVEL_CONNECT, "Could not connect to [%s]:%s: %s.", + csp->http->host_ip_addr_str, service, strerror(socket_error)); + } } else { + socket_error = errno; log_error(LOG_LEVEL_ERROR, "Could not get the state of " "the connection to [%s]:%s: %s; dropping connection.", csp->http->host_ip_addr_str, service, strerror(errno)); @@ -323,8 +379,9 @@ freeaddrinfo(result); if (!rp) { - log_error(LOG_LEVEL_CONNECT, "Could not connect to [%s]:%s.", - host, service); + log_error(LOG_LEVEL_CONNECT, "Could not connect to [%s]:%s: %s.", + host, service, strerror(socket_error)); + csp->error_message = strdup(strerror(socket_error)); return(JB_INVALID_SOCKET); } log_error(LOG_LEVEL_CONNECT, "Connected to %s[%s]:%s.", @@ -337,7 +394,7 @@ #else /* ndef HAVE_RFC2553 */ /* Pre-getaddrinfo implementation */ -jb_socket connect_to(const char *host, int portnum, struct client_state *csp) +static jb_socket no_rfc2553_connect_to(const char *host, int portnum, struct client_state *csp) { struct sockaddr_in inaddr; jb_socket fd; @@ -352,6 +409,9 @@ struct access_control_addr dst[1]; #endif /* def FEATURE_ACL */ + /* Don't leak memory when retrying. */ + freez(csp->http->host_ip_addr_str); + memset((char *)&inaddr, 0, sizeof inaddr); if ((addr = resolve_hostname_to_ip(host)) == INADDR_NONE) @@ -392,10 +452,11 @@ } #endif /* ndef _WIN32 */ + fd = socket(inaddr.sin_family, SOCK_STREAM, 0); #ifdef _WIN32 - if ((fd = socket(inaddr.sin_family, SOCK_STREAM, 0)) == JB_INVALID_SOCKET) + if (fd == JB_INVALID_SOCKET) #else - if ((fd = socket(inaddr.sin_family, SOCK_STREAM, 0)) < 0) + if (fd < 0) #endif { return(JB_INVALID_SOCKET); @@ -420,7 +481,7 @@ { #ifdef _WIN32 if (errno == WSAEINPROGRESS) -#elif __OS2__ +#elif __OS2__ if (sock_errno() == EINPROGRESS) #else /* ifndef _WIN32 */ if (errno == EINPROGRESS) @@ -429,7 +490,7 @@ break; } -#ifdef __OS2__ +#ifdef __OS2__ if (sock_errno() != EINTR) #else if (errno != EINTR) @@ -455,7 +516,7 @@ tv->tv_sec = 30; tv->tv_usec = 0; - /* MS Windows uses int, not SOCKET, for the 1st arg of select(). Wierd! */ + /* MS Windows uses int, not SOCKET, for the 1st arg of select(). Weird! */ if (select((int)fd + 1, NULL, &wfds, NULL, tv) <= 0) { close_socket(fd); @@ -493,11 +554,6 @@ return 0; } - if (len < 0) /* constant condition - size_t isn't ever negative */ - { - return 1; - } - log_error(LOG_LEVEL_WRITING, "to socket %d: %N", fd, len, buf); #if defined(_WIN32) @@ -641,7 +697,7 @@ #if defined(_WIN32) || defined(__BEOS__) closesocket(fd); #elif defined(AMIGA) - CloseSocket(fd); + CloseSocket(fd); #elif defined(__OS2__) soclose(fd); #else @@ -717,10 +773,7 @@ } hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; -#ifdef AI_ADDRCONFIG - hints.ai_flags |= AI_ADDRCONFIG; -#endif - hints.ai_protocol = 0; /* Realy any stream protocol or TCP only */ + hints.ai_protocol = 0; /* Really any stream protocol or TCP only */ hints.ai_canonname = NULL; hints.ai_addr = NULL; hints.ai_next = NULL; @@ -871,14 +924,17 @@ * 1 : afd = File descriptor returned from accept(). * 2 : ip_address = Pointer to return the pointer to * the ip address string. - * 3 : hostname = Pointer to return the pointer to + * 3 : port = Pointer to return the pointer to + * the TCP port string. + * 4 : hostname = Pointer to return the pointer to * the hostname or NULL if the caller * isn't interested in it. * * Returns : void. * *********************************************************************/ -void get_host_information(jb_socket afd, char **ip_address, char **hostname) +void get_host_information(jb_socket afd, char **ip_address, char **port, + char **hostname) { #ifdef HAVE_RFC2553 struct sockaddr_storage server; @@ -911,6 +967,7 @@ *hostname = NULL; } *ip_address = NULL; + *port = NULL; if (!getsockname(afd, (struct sockaddr *) &server, &s_length)) { @@ -919,25 +976,36 @@ log_error(LOG_LEVEL_ERROR, "getsockname() truncated server address"); return; } + *port = malloc(NI_MAXSERV); + if (NULL == *port) + { + log_error(LOG_LEVEL_ERROR, + "Out of memory while getting the client's port."); + return; + } #ifdef HAVE_RFC2553 *ip_address = malloc(NI_MAXHOST); if (NULL == *ip_address) { log_error(LOG_LEVEL_ERROR, "Out of memory while getting the client's IP address."); + freez(*port); return; } retval = getnameinfo((struct sockaddr *) &server, s_length, - *ip_address, NI_MAXHOST, NULL, 0, NI_NUMERICHOST); + *ip_address, NI_MAXHOST, *port, NI_MAXSERV, + NI_NUMERICHOST|NI_NUMERICSERV); if (retval) { log_error(LOG_LEVEL_ERROR, "Unable to print my own IP address: %s", gai_strerror(retval)); freez(*ip_address); + freez(*port); return; } #else *ip_address = strdup(inet_ntoa(server.sin_addr)); + snprintf(*port, NI_MAXSERV, "%hu", ntohs(server.sin_port)); #endif /* HAVE_RFC2553 */ if (NULL == hostname) { @@ -987,11 +1055,11 @@ } #elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&resolver_mutex); - host = gethostbyaddr((const char *)&server.sin_addr, + host = gethostbyaddr((const char *)&server.sin_addr, sizeof(server.sin_addr), AF_INET); privoxy_mutex_unlock(&resolver_mutex); #else - host = gethostbyaddr((const char *)&server.sin_addr, + host = gethostbyaddr((const char *)&server.sin_addr, sizeof(server.sin_addr), AF_INET); #endif if (host == NULL) @@ -1013,24 +1081,24 @@ * * Function : accept_connection * - * Description : Accepts a connection on a socket. Socket must have - * been created using bind_port(). + * Description : Accepts a connection on one of possibly multiple + * sockets. The socket(s) to check must have been + * created using bind_port(). * * Parameters : - * 1 : csp = Client state, cfd, ip_addr_str, and - * ip_addr_long will be set by this routine. - * 2 : fd = file descriptor returned from bind_port + * 1 : csp = Client state, cfd, ip_addr_str, and + * ip_addr_long will be set by this routine. + * 2 : fds = File descriptors returned from bind_port * * Returns : when a connection is accepted, it returns 1 (TRUE). * On an error it returns 0 (FALSE). * *********************************************************************/ -int accept_connection(struct client_state * csp, jb_socket fd) +int accept_connection(struct client_state * csp, jb_socket fds[]) { #ifdef HAVE_RFC2553 /* XXX: client is stored directly into csp->tcp_addr */ #define client (csp->tcp_addr) - int retval; #else struct sockaddr_in client; #endif @@ -1041,9 +1109,69 @@ #else socklen_t c_length; #endif + int retval; + int i; + int max_selected_socket; + fd_set selected_fds; + jb_socket fd; c_length = sizeof(client); + /* + * Wait for a connection on any socket. + * Return immediately if no socket is listening. + * XXX: Why not treat this as fatal error? + */ + FD_ZERO(&selected_fds); + max_selected_socket = 0; + for (i = 0; i < MAX_LISTENING_SOCKETS; i++) + { + if (JB_INVALID_SOCKET != fds[i]) + { + FD_SET(fds[i], &selected_fds); + if (max_selected_socket < fds[i] + 1) + { + max_selected_socket = fds[i] + 1; + } + } + } + if (0 == max_selected_socket) + { + return 0; + } + do + { + retval = select(max_selected_socket, &selected_fds, NULL, NULL, NULL); + } while (retval < 0 && errno == EINTR); + if (retval <= 0) + { + if (0 == retval) + { + log_error(LOG_LEVEL_ERROR, + "Waiting on new client failed because select(2) returned 0." + " This should not happen."); + } + else + { + log_error(LOG_LEVEL_ERROR, + "Waiting on new client failed because of problems in select(2): " + "%s.", strerror(errno)); + } + return 0; + } + for (i = 0; i < MAX_LISTENING_SOCKETS && !FD_ISSET(fds[i], &selected_fds); + i++); + if (i >= MAX_LISTENING_SOCKETS) + { + log_error(LOG_LEVEL_ERROR, + "select(2) reported connected clients (number = %u, " + "descriptor boundary = %u), but none found.", + retval, max_selected_socket); + return 0; + } + fd = fds[i]; + + /* Accept selected connection */ #ifdef _WIN32 afd = accept (fd, (struct sockaddr *) &client, &c_length); if (afd == JB_INVALID_SOCKET) @@ -1081,7 +1209,7 @@ if (!csp->ip_addr_str || retval) { log_error(LOG_LEVEL_ERROR, "Can not save csp->ip_addr_str: %s", - (csp->ip_addr_str) ? gai_strerror(retval) : "Insuffcient memory"); + (csp->ip_addr_str) ? gai_strerror(retval) : "Insuffcient memory"); freez(csp->ip_addr_str); } #undef client @@ -1105,7 +1233,7 @@ * Parameters : * 1 : host = hostname to resolve * - * Returns : INADDR_NONE => failure, INADDR_ANY or tcp/ip address if succesful. + * Returns : INADDR_NONE => failure, INADDR_ANY or tcp/ip address if successful. * *********************************************************************/ unsigned long resolve_hostname_to_ip(const char *host) @@ -1136,7 +1264,7 @@ while (gethostbyname_r(host, &result, hbuf, HOSTENT_BUFFER_SIZE, &hostp, &thd_err) && (thd_err == TRY_AGAIN) && (dns_retries++ < MAX_DNS_RETRIES)) - { + { log_error(LOG_LEVEL_ERROR, "Timeout #%u while trying to resolve %s. Trying again.", dns_retries, host); @@ -1145,7 +1273,7 @@ while (NULL == (hostp = gethostbyname_r(host, &result, hbuf, HOSTENT_BUFFER_SIZE, &thd_err)) && (thd_err == TRY_AGAIN) && (dns_retries++ < MAX_DNS_RETRIES)) - { + { log_error(LOG_LEVEL_ERROR, "Timeout #%u while trying to resolve %s. Trying again.", dns_retries, host); @@ -1167,7 +1295,7 @@ privoxy_mutex_lock(&resolver_mutex); while (NULL == (hostp = gethostbyname(host)) && (h_errno == TRY_AGAIN) && (dns_retries++ < MAX_DNS_RETRIES)) - { + { log_error(LOG_LEVEL_ERROR, "Timeout #%u while trying to resolve %s. Trying again.", dns_retries, host); @@ -1200,7 +1328,7 @@ errno = WSAEPROTOTYPE; #else errno = EPROTOTYPE; -#endif +#endif log_error(LOG_LEVEL_ERROR, "hostname %s resolves to unknown address type.", host); return(INADDR_NONE); } diff -Nru privoxy-3.0.17/jbsockets.h privoxy-3.0.19/jbsockets.h --- privoxy-3.0.17/jbsockets.h 2010-04-23 11:53:48.000000000 +0000 +++ privoxy-3.0.19/jbsockets.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef JBSOCKETS_H_INCLUDED #define JBSOCKETS_H_INCLUDED -#define JBSOCKETS_H_VERSION "$Id: jbsockets.h,v 1.17 2010/04/23 11:53:48 fabiankeil Exp $" +#define JBSOCKETS_H_VERSION "$Id: jbsockets.h,v 1.20 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.h,v $ @@ -14,10 +14,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -57,8 +57,8 @@ extern void close_socket(jb_socket fd); extern int bind_port(const char *hostnam, int portnum, jb_socket *pfd); -extern int accept_connection(struct client_state * csp, jb_socket fd); -extern void get_host_information(jb_socket afd, char **ip_address, char **hostname); +extern int accept_connection(struct client_state * csp, jb_socket fds[]); +extern void get_host_information(jb_socket afd, char **ip_address, char **port, char **hostname); extern unsigned long resolve_hostname_to_ip(const char *host); @@ -68,6 +68,15 @@ extern const char jbsockets_rcs[]; extern const char jbsockets_h_rcs[]; +/* + * Solaris workaround + * XXX: still necessary? + */ +#ifndef INADDR_NONE +#define INADDR_NONE -1 +#endif + + #ifdef __cplusplus } /* extern "C" */ #endif diff -Nru privoxy-3.0.17/jcc.c privoxy-3.0.19/jcc.c --- privoxy-3.0.17/jcc.c 2010-11-06 11:48:32.000000000 +0000 +++ privoxy-3.0.19/jcc.c 2011-12-10 17:26:11.000000000 +0000 @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.331 2010/11/06 11:48:32 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.375 2011/12/10 17:26:11 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -151,7 +151,9 @@ static void usage(const char *myname); #endif static void initialize_mutexes(void); -static jb_socket bind_port_helper(struct configuration_spec *config); +static jb_socket bind_port_helper(const char *haddr, int hport); +static void bind_ports_helper(struct configuration_spec *config, jb_socket sockets[]); +static void close_ports_helper(jb_socket sockets[]); static void listen_loop(void); #ifdef AMIGA @@ -206,31 +208,31 @@ /* HTTP snipplets. */ static const char CSUCCEED[] = - "HTTP/1.0 200 Connection established\r\n" + "HTTP/1.1 200 Connection established\r\n" "Proxy-Agent: Privoxy/" VERSION "\r\n\r\n"; static const char CHEADER[] = - "HTTP/1.0 400 Invalid header received from client\r\n" + "HTTP/1.1 400 Invalid header received from client\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Invalid header received from client.\r\n"; static const char FTP_RESPONSE[] = - "HTTP/1.0 400 Invalid request received from client\r\n" + "HTTP/1.1 400 Invalid request received from client\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Invalid request. Privoxy doesn't support FTP.\r\n"; static const char GOPHER_RESPONSE[] = - "HTTP/1.0 400 Invalid request received from client\r\n" + "HTTP/1.1 400 Invalid request received from client\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Invalid request. Privoxy doesn't support gopher.\r\n"; /* XXX: should be a template */ static const char MISSING_DESTINATION_RESPONSE[] = - "HTTP/1.0 400 Bad request received from client\r\n" + "HTTP/1.1 400 Bad request received from client\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" @@ -238,7 +240,7 @@ /* XXX: should be a template */ static const char INVALID_SERVER_HEADERS_RESPONSE[] = - "HTTP/1.0 502 Server or forwarder response invalid\r\n" + "HTTP/1.1 502 Server or forwarder response invalid\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" @@ -246,21 +248,21 @@ /* XXX: should be a template */ static const char MESSED_UP_REQUEST_RESPONSE[] = - "HTTP/1.0 400 Malformed request after rewriting\r\n" + "HTTP/1.1 400 Malformed request after rewriting\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Bad request. Messed up with header filters.\r\n"; static const char TOO_MANY_CONNECTIONS_RESPONSE[] = - "HTTP/1.0 503 Too many open connections\r\n" + "HTTP/1.1 503 Too many open connections\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" "Maximum number of open connections reached.\r\n"; static const char CLIENT_CONNECTION_TIMEOUT_RESPONSE[] = - "HTTP/1.0 504 Connection timeout\r\n" + "HTTP/1.1 504 Connection timeout\r\n" "Proxy-Agent: Privoxy " VERSION "\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n\r\n" @@ -315,7 +317,7 @@ #if !defined(_WIN32) && !defined(__OS2__) && !defined(AMIGA) /********************************************************************* * - * Function : sig_handler + * Function : sig_handler * * Description : Signal handler for different signals. * Exit gracefully on TERM and INT @@ -325,7 +327,7 @@ * Parameters : * 1 : the_signal = the signal cause this function to call * - * Returns : - + * Returns : - * *********************************************************************/ static void sig_handler(int the_signal) @@ -348,10 +350,10 @@ #if defined(unix) received_hup_signal = 1; #endif - break; + break; default: - /* + /* * We shouldn't be here, unless we catch signals * in main() that we can't handle here! */ @@ -563,7 +565,7 @@ log_error(LOG_LEVEL_HEADER, "Continue hack in da house."); continue_hack_in_da_house = 1; } - else if (*header == '\0') + else if (*header == '\0') { /* * If the header is empty, but the Continue hack @@ -721,7 +723,7 @@ if (cgi_error_memory() != rsp) { free_http_response(rsp); - } + } return; } @@ -749,7 +751,7 @@ /* * If CGI request crunching is disabled, * check the CGI dispatcher out of order to - * prevent unintentional blocks or redirects. + * prevent unintentional blocks or redirects. */ if (!(csp->config->feature_flags & RUNTIME_FEATURE_CGI_CRUNCHING) && (NULL != (rsp = dispatch_cgi(csp)))) @@ -1151,14 +1153,20 @@ *********************************************************************/ static void mark_server_socket_tainted(struct client_state *csp) { + /* + * For consistency we always mark the server socket + * tainted, however, to reduce the log noise we only + * emit a log message if the server socket could have + * actually been reused. + */ if ((csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE) && !(csp->flags |= CSP_FLAG_SERVER_SOCKET_TAINTED)) { log_error(LOG_LEVEL_CONNECT, "Marking the server socket %d tainted.", csp->server_connection.sfd); - csp->flags |= CSP_FLAG_SERVER_SOCKET_TAINTED; } + csp->flags |= CSP_FLAG_SERVER_SOCKET_TAINTED; } /********************************************************************* @@ -1222,10 +1230,6 @@ * Description : Read the client's request (more precisely the * client headers) and answer it if necessary. * - * Note that since we're not using select() we could get - * blocked here if a client connected, then didn't say - * anything! - * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * @@ -1331,7 +1335,7 @@ destroy_list(headers); return JB_ERR_PARSE; } - + if (add_to_iob(csp, buf, len)) { /* @@ -1346,7 +1350,7 @@ { /* * We were able to read a complete - * header and can finaly enlist it. + * header and can finally enlist it. */ enlist(headers, p); freez(p); @@ -1389,7 +1393,7 @@ get_url_actions(csp, http); } - /* + /* * Save a copy of the original request for logging */ http->ocmd = strdup(http->cmd); @@ -1489,7 +1493,7 @@ * this function is called (via serve()) to handle the * main business of the communication. This function * returns after dealing with a single request. It can - * be called multiple times witht the same client socket + * be called multiple times with the same client socket * if the client is keeping the connection alive. * * The decision whether or not a client connection will @@ -1516,8 +1520,6 @@ int server_body; int ms_iis5_hack = 0; unsigned long long byte_count = 0; - int forwarded_connect_retries = 0; - int max_forwarded_connect_retries = csp->config->forwarded_connect_retries; const struct forward_spec *fwd; struct http_request *http; long len = 0; /* for buffer sizes (and negative error codes) */ @@ -1595,8 +1597,8 @@ csp->action->string[ACTION_STRING_LIMIT_CONNECT]; assert(NULL != acceptable_connect_ports); log_error(LOG_LEVEL_INFO, "Request from %s marked for blocking. " - "limit-connect{%s} doesn't allow CONNECT requests to port %d.", - csp->ip_addr_str, acceptable_connect_ports, csp->http->port); + "limit-connect{%s} doesn't allow CONNECT requests to %s", + csp->ip_addr_str, acceptable_connect_ports, csp->http->hostport); csp->action->flags |= ACTION_BLOCK; http->ssl = 0; } @@ -1653,14 +1655,7 @@ } #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ - while ((csp->server_connection.sfd = forwarded_connect(fwd, http, csp)) - && (errno == EINVAL) - && (forwarded_connect_retries++ < max_forwarded_connect_retries)) - { - log_error(LOG_LEVEL_ERROR, - "failed request #%u to connect to %s. Trying again.", - forwarded_connect_retries, http->hostport); - } + csp->server_connection.sfd = forwarded_connect(fwd, http, csp); if (csp->server_connection.sfd == JB_INVALID_SOCKET) { @@ -1676,8 +1671,6 @@ else { rsp = error_response(csp, "connect-failed"); - log_error(LOG_LEVEL_CONNECT, "connect to: %s failed: %E", - http->hostport); } /* Write the answer to the client */ @@ -1696,16 +1689,16 @@ } #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ - hdr = list_to_text(csp->headers); - if (hdr == NULL) - { - /* FIXME Should handle error properly */ - log_error(LOG_LEVEL_FATAL, "Out of memory parsing client header"); - } - list_remove_all(csp->headers); - if (fwd->forward_host || (http->ssl == 0)) { + hdr = list_to_text(csp->headers); + if (hdr == NULL) + { + /* FIXME Should handle error properly */ + log_error(LOG_LEVEL_FATAL, "Out of memory parsing client header"); + } + list_remove_all(csp->headers); + /* * Write the client's (modified) header to the server * (along with anything else that may be in the buffer) @@ -1725,17 +1718,18 @@ freez(hdr); return; } + freez(hdr); } else { /* * We're running an SSL tunnel and we're not forwarding, - * so just send the "connect succeeded" message to the - * client, flush the rest, and get out of the way. + * so just ditch the client headers, send the "connect succeeded" + * message to the client, flush the rest, and get out of the way. */ + list_remove_all(csp->headers); if (write_socket(csp->cfd, CSUCCEED, strlen(CSUCCEED))) { - freez(hdr); return; } IOB_RESET(csp); @@ -1745,9 +1739,6 @@ csp->server_connection.request_sent = time(NULL); - /* we're finished with the client's header */ - freez(hdr); - maxfd = (csp->cfd > csp->server_connection.sfd) ? csp->cfd : csp->server_connection.sfd; @@ -1943,7 +1934,14 @@ if (FD_ISSET(csp->server_connection.sfd, &rfds)) { #ifdef FEATURE_CONNECTION_KEEP_ALIVE - if (!socket_is_still_alive(csp->cfd)) + /* + * If we are buffering content, we don't want to eat up to + * buffer-limit bytes if the client no longer cares about them. + * If we aren't buffering, however, a dead client socket will be + * noticed pretty much right away anyway, so we can reduce the + * overhead by skipping the check. + */ + if (buffer_and_filter_content && !socket_is_still_alive(csp->cfd)) { #ifdef _WIN32 log_error(LOG_LEVEL_CONNECT, @@ -2059,6 +2057,20 @@ { csp->content_length = (size_t)(csp->iob->eod - csp->iob->cur); } +#ifdef FEATURE_COMPRESSION + else if ((csp->flags & CSP_FLAG_CLIENT_SUPPORTS_DEFLATE) + && (csp->content_length > LOWER_LENGTH_LIMIT_FOR_COMPRESSION)) + { + char *compressed_content = compress_buffer(p, + (size_t *)&csp->content_length, csp->config->compression_level); + if (compressed_content != NULL) + { + freez(p); + p = compressed_content; + csp->flags |= CSP_FLAG_BUFFERED_CONTENT_DEFLATED; + } + } +#endif if (JB_ERR_OK != update_server_headers(csp)) { @@ -2131,7 +2143,7 @@ hdr = list_to_text(csp->headers); if (hdr == NULL) { - /* + /* * Memory is too tight to even generate the header. * Send our static "Out-of-memory" page. */ @@ -2188,7 +2200,7 @@ { log_error(LOG_LEVEL_ERROR, "Out of memory while looking for end of server headers."); rsp = cgi_error_memory(); - send_crunch_response(csp, rsp); + send_crunch_response(csp, rsp); mark_server_socket_tainted(csp); return; } @@ -2240,18 +2252,19 @@ if ((csp->flags & CSP_FLAG_REUSED_CLIENT_CONNECTION)) { log_error(LOG_LEVEL_ERROR, - "Empty server or forwarder response received on socket %d. " + "No server or forwarder response received on socket %d. " "Closing client socket %d without sending data.", csp->server_connection.sfd, csp->cfd); + log_error(LOG_LEVEL_CLF, + "%s - - [%T] \"%s\" 502 0", csp->ip_addr_str, http->cmd); } else { log_error(LOG_LEVEL_ERROR, - "Empty server or forwarder response received on socket %d.", + "No server or forwarder response received on socket %d.", csp->server_connection.sfd); send_crunch_response(csp, error_response(csp, "no-server-data")); } - log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 502 0", csp->ip_addr_str, http->cmd); free_http_request(http); mark_server_socket_tainted(csp); return; @@ -2388,7 +2401,7 @@ if (csp->content_length == 0) { /* - * If Privoxy didn't recalculate the Content-Lenght, + * If Privoxy didn't recalculate the Content-Length, * byte_count is still correct. */ csp->content_length = byte_count; @@ -2427,6 +2440,8 @@ *********************************************************************/ static void prepare_csp_for_next_request(struct client_state *csp) { + unsigned int toggled_on_flag_set = (0 != (csp->flags & CSP_FLAG_TOGGLED_ON)); + csp->content_type = 0; csp->content_length = 0; csp->expected_content_length = 0; @@ -2445,9 +2460,11 @@ csp->fwd = NULL; } /* XXX: Store per-connection flags someplace else. */ - csp->flags &= CSP_FLAG_TOGGLED_ON; - csp->flags |= CSP_FLAG_ACTIVE; - csp->flags |= CSP_FLAG_REUSED_CLIENT_CONNECTION; + csp->flags = (CSP_FLAG_ACTIVE | CSP_FLAG_REUSED_CLIENT_CONNECTION); + if (toggled_on_flag_set) + { + csp->flags |= CSP_FLAG_TOGGLED_ON; + } } #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ @@ -2481,6 +2498,7 @@ do { unsigned int latency; + int config_file_change_detected = 0; /* Only used for debugging */ chat(csp); @@ -2493,10 +2511,13 @@ continue_chatting = (csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) - && (((csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE) - && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED)) - || (csp->flags & CSP_FLAG_CRUNCHED)) - && (csp->cfd != JB_INVALID_SOCKET); + && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED) + && ((csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE) + || (csp->flags & CSP_FLAG_CRUNCHED)) + && (csp->cfd != JB_INVALID_SOCKET) + && ((csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE) + || (csp->config->feature_flags & + RUNTIME_FEATURE_CONNECTION_SHARING)); if (continue_chatting && !(csp->flags & CSP_FLAG_CRUNCHED)) { @@ -2515,39 +2536,49 @@ } } + if (continue_chatting && any_loaded_file_changed(csp->config->config_file_list)) + { + continue_chatting = 0; + config_file_change_detected = 1; + } + if (continue_chatting) { - unsigned int client_timeout; + unsigned int client_timeout = 1; /* XXX: Use something else here? */ - if (csp->server_connection.sfd != JB_INVALID_SOCKET) - { - client_timeout = (unsigned)csp->server_connection.keep_alive_timeout - latency; - log_error(LOG_LEVEL_CONNECT, - "Waiting for the next client request on socket %d. " - "Keeping the server socket %d to %s open.", - csp->cfd, csp->server_connection.sfd, csp->server_connection.host); - } - else + if (0 != (csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)) { - client_timeout = 1; /* XXX: Use something else here? */ - log_error(LOG_LEVEL_CONNECT, - "Waiting for the next client request on socket %d. " - "No server socket to keep open.", csp->cfd); + if (csp->server_connection.sfd != JB_INVALID_SOCKET) + { + client_timeout = (unsigned)csp->server_connection.keep_alive_timeout - latency; + log_error(LOG_LEVEL_CONNECT, + "Waiting for the next client request on socket %d. " + "Keeping the server socket %d to %s open.", + csp->cfd, csp->server_connection.sfd, csp->server_connection.host); + } + else + { + log_error(LOG_LEVEL_CONNECT, + "Waiting for the next client request on socket %d. " + "No server socket to keep open.", csp->cfd); + } } if ((csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE) && data_is_available(csp->cfd, (int)client_timeout) && socket_is_still_alive(csp->cfd)) { - log_error(LOG_LEVEL_CONNECT, "Client request arrived in " - "time or the client closed the connection on socket %d.", - csp->cfd); + log_error(LOG_LEVEL_CONNECT, + "Client request arrived in time on socket %d.", csp->cfd); prepare_csp_for_next_request(csp); } else { - log_error(LOG_LEVEL_CONNECT, - "No additional client request received in time on socket %d.", - csp->cfd); + if (0 != (csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)) + { + log_error(LOG_LEVEL_CONNECT, + "No additional client request received in time on socket %d.", + csp->cfd); + } #ifdef FEATURE_CONNECTION_SHARING if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING) && (socket_is_still_alive(csp->server_connection.sfd))) @@ -2581,8 +2612,17 @@ else if (csp->server_connection.sfd != JB_INVALID_SOCKET) { log_error(LOG_LEVEL_CONNECT, - "The connection on server socket %d to %s isn't reusable. " - "Closing.", csp->server_connection.sfd, csp->server_connection.host); + "The connection on server socket %d to %s isn't reusable. Closing. " + "Server connection: keep-alive %u, tainted: %u, socket alive %u. " + "Client connection: socket alive: %u. Server timeout: %u. " + "Configuration file change detected: %u", + csp->server_connection.sfd, csp->server_connection.host, + 0 != (csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE), + 0 != (csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED), + socket_is_still_alive(csp->server_connection.sfd), + socket_is_still_alive(csp->cfd), + csp->server_connection.keep_alive_timeout, + config_file_change_detected); } } while (continue_chatting); @@ -2807,6 +2847,7 @@ #ifndef HAVE_RANDOM privoxy_mutex_init(&rand_mutex); #endif /* ndef HAVE_RANDOM */ + #endif /* def MUTEX_LOCKS_AVAILABLE */ } @@ -2845,7 +2886,6 @@ #ifdef unix struct passwd *pw = NULL; struct group *grp = NULL; - char *p; int do_chroot = 0; char *pre_chroot_nslookup_to_load_resolver = NULL; #endif @@ -2884,7 +2924,7 @@ pName++; exit( (install_service(pName)) ? 0 : 1 ); } - else if (strncmp(argv[argc_pos], "--uninstall", + 11) == 0) + else if (strncmp(argv[argc_pos], "--uninstall", 11) == 0) { const char *pName = argv[argc_pos] + 11; if (*pName == ':') @@ -2930,23 +2970,39 @@ else if (strcmp(argv[argc_pos], "--user" ) == 0) { + char *user_arg; + char *group_name; + if (++argc_pos == argc) usage(argv[argc_pos]); - if ((NULL != (p = strchr(argv[argc_pos], '.'))) && *(p + 1) != '0') + user_arg = strdup(argv[argc_pos]); + if (NULL == user_arg) { - *p++ = '\0'; - if (NULL == (grp = getgrnam(p))) + log_error(LOG_LEVEL_FATAL, + "Out of memory splitting --user argument '%s'.", argv[argc_pos]); + } + group_name = strchr(user_arg, '.'); + if (NULL != group_name) + { + /* Nul-terminate the user name */ + *group_name = '\0'; + + /* Skip the former delimiter to actually reach the group name */ + group_name++; + + grp = getgrnam(group_name); + if (NULL == grp) { - log_error(LOG_LEVEL_FATAL, "Group %s not found.", p); + log_error(LOG_LEVEL_FATAL, "Group '%s' not found.", group_name); } } - - if (NULL == (pw = getpwnam(argv[argc_pos]))) + pw = getpwnam(user_arg); + if (NULL == pw) { - log_error(LOG_LEVEL_FATAL, "User %s not found.", argv[argc_pos]); + log_error(LOG_LEVEL_FATAL, "User '%s' not found.", user_arg); } - if (p != NULL) *--p = '\0'; + freez(user_arg); } else if (strcmp(argv[argc_pos], "--pre-chroot-nslookup" ) == 0) @@ -2986,7 +3042,7 @@ { char cwd[BUFFER_SIZE]; char *abs_file; - size_t abs_file_size; + size_t abs_file_size; /* make config-filename absolute here */ if (NULL == getcwd(cwd, sizeof(cwd))) @@ -3040,12 +3096,11 @@ #if !defined(_WIN32) && !defined(__OS2__) && !defined(AMIGA) { int idx; - const int catched_signals[] = { SIGTERM, SIGINT, SIGHUP, 0 }; - const int ignored_signals[] = { SIGPIPE, 0 }; + const int catched_signals[] = { SIGTERM, SIGINT, SIGHUP }; - for (idx = 0; catched_signals[idx] != 0; idx++) + for (idx = 0; idx < SZ(catched_signals); idx++) { -#ifdef sun /* FIXME: Is it safe to check for HAVE_SIGSET instead? */ +#ifdef sun /* FIXME: Is it safe to check for HAVE_SIGSET instead? */ if (sigset(catched_signals[idx], sig_handler) == SIG_ERR) #else if (signal(catched_signals[idx], sig_handler) == SIG_ERR) @@ -3055,12 +3110,9 @@ } } - for (idx = 0; ignored_signals[idx] != 0; idx++) + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - if (signal(ignored_signals[idx], SIG_IGN) == SIG_ERR) - { - log_error(LOG_LEVEL_FATAL, "Can't set ignore-handler for signal %d: %E", ignored_signals[idx]); - } + log_error(LOG_LEVEL_FATAL, "Can't set ignore-handler for SIGPIPE: %E"); } } @@ -3215,7 +3267,7 @@ if (putenv(putenv_dummy) != 0) { log_error(LOG_LEVEL_FATAL, "Cannot putenv(): HOME"); - } + } snprintf(putenv_dummy, sizeof(putenv_dummy), "USER=%s", pw->pw_name); if (putenv(putenv_dummy) != 0) @@ -3236,7 +3288,7 @@ */ if (bRunAsService) { - /* Yup, so now we must attempt to establish a connection + /* Yup, so now we must attempt to establish a connection * with the service dispatcher. This will only work if this * process was launched by the service control manager to * actually run as a service. If this isn't the case, i've @@ -3278,61 +3330,127 @@ * on failure. * * Parameters : - * 1 : config = Privoxy configuration. Specifies port - * to bind to. + * 1 : haddr = Host addres to bind to. Use NULL to bind to + * INADDR_ANY. + * 2 : hport = Specifies port to bind to. * * Returns : Port that was opened. * *********************************************************************/ -static jb_socket bind_port_helper(struct configuration_spec * config) +static jb_socket bind_port_helper(const char *haddr, int hport) { int result; jb_socket bfd; - if (config->haddr == NULL) - { - log_error(LOG_LEVEL_INFO, "Listening on port %d on all IP addresses", - config->hport); - } - else - { - log_error(LOG_LEVEL_INFO, "Listening on port %d on IP address %s", - config->hport, config->haddr); - } - - result = bind_port(config->haddr, config->hport, &bfd); + result = bind_port(haddr, hport, &bfd); if (result < 0) { + const char *bind_address = (NULL != haddr) ? haddr : "INADDR_ANY"; switch(result) { - case -3 : - log_error(LOG_LEVEL_FATAL, "can't bind to %s:%d: " - "There may be another Privoxy or some other " - "proxy running on port %d", - (NULL != config->haddr) ? config->haddr : "INADDR_ANY", - config->hport, config->hport); - - case -2 : - log_error(LOG_LEVEL_FATAL, "can't bind to %s:%d: " - "The hostname is not resolvable", - (NULL != config->haddr) ? config->haddr : "INADDR_ANY", config->hport); + case -3: + log_error(LOG_LEVEL_FATAL, + "can't bind to %s:%d: There may be another Privoxy " + "or some other proxy running on port %d", + bind_address, hport, hport); + + case -2: + log_error(LOG_LEVEL_FATAL, + "can't bind to %s:%d: The hostname is not resolvable", + bind_address, hport); - default : + default: log_error(LOG_LEVEL_FATAL, "can't bind to %s:%d: %E", - (NULL != config->haddr) ? config->haddr : "INADDR_ANY", config->hport); + bind_address, hport); } /* shouldn't get here */ return JB_INVALID_SOCKET; } - config->need_bind = 0; + if (haddr == NULL) + { + log_error(LOG_LEVEL_INFO, "Listening on port %d on all IP addresses", + hport); + } + else + { + log_error(LOG_LEVEL_INFO, "Listening on port %d on IP address %s", + hport, haddr); + } return bfd; } +/********************************************************************* + * + * Function : bind_ports_helper + * + * Description : Bind the listen ports. Handles logging, and aborts + * on failure. + * + * Parameters : + * 1 : config = Privoxy configuration. Specifies ports + * to bind to. + * 2 : sockets = Preallocated array of opened sockets + * corresponding to specification in config. + * All non-opened sockets will be set to + * JB_INVALID_SOCKET. + * + * Returns : Nothing. Inspect sockets argument. + * + *********************************************************************/ +static void bind_ports_helper(struct configuration_spec * config, + jb_socket sockets[]) +{ + int i; + + for (i = 0; i < MAX_LISTENING_SOCKETS; i++) + { + if (config->hport[i]) + { + sockets[i] = bind_port_helper(config->haddr[i], config->hport[i]); + } + else + { + sockets[i] = JB_INVALID_SOCKET; + } + } + config->need_bind = 0; +} + + +/********************************************************************* + * + * Function : close_ports_helper + * + * Description : Close listenings ports. + * + * Parameters : + * 1 : sockets = Array of opened and non-opened sockets to + * close. All sockets will be set to + * JB_INVALID_SOCKET. + * + * Returns : Nothing. + * + *********************************************************************/ +static void close_ports_helper(jb_socket sockets[]) +{ + int i; + + for (i = 0; i < MAX_LISTENING_SOCKETS; i++) + { + if (JB_INVALID_SOCKET != sockets[i]) + { + close_socket(sockets[i]); + } + sockets[i] = JB_INVALID_SOCKET; + } +} + + #ifdef _WIN32 /* Without this simple workaround we get this compiler warning from _beginthread * warning C4028: formal parameter 1 different from declaration @@ -3359,7 +3477,7 @@ { struct client_states *csp_list = NULL; struct client_state *csp = NULL; - jb_socket bfd; + jb_socket bfds[MAX_LISTENING_SOCKETS]; struct configuration_spec *config; unsigned int active_threads = 0; @@ -3373,7 +3491,7 @@ initialize_reusable_connections(); #endif /* def FEATURE_CONNECTION_SHARING */ - bfd = bind_port_helper(config); + bind_ports_helper(config, bfds); #ifdef FEATURE_GRACEFUL_TERMINATION while (!g_terminate) @@ -3416,12 +3534,34 @@ } csp = &csp_list->csp; + log_error(LOG_LEVEL_CONNECT, "Listening for new connections ... "); + + if (!accept_connection(csp, bfds)) + { + log_error(LOG_LEVEL_CONNECT, "accept failed: %E"); + +#ifdef AMIGA + if(!childs) + { + exit(1); + } +#endif + freez(csp_list); + continue; + } + else + { + log_error(LOG_LEVEL_CONNECT, + "accepted connection from %s on socket %d", + csp->ip_addr_str, csp->cfd); + } + csp->flags |= CSP_FLAG_ACTIVE; csp->server_connection.sfd = JB_INVALID_SOCKET; csp->config = config = load_config(); - if ( config->need_bind ) + if (config->need_bind) { /* * Since we were listening to the "old port", we will not see @@ -3436,31 +3576,9 @@ * that this will hurt people's feelings. */ - close_socket(bfd); + close_ports_helper(bfds); - bfd = bind_port_helper(config); - } - - log_error(LOG_LEVEL_CONNECT, "Listening for new connections ... "); - - if (!accept_connection(csp, bfd)) - { - log_error(LOG_LEVEL_CONNECT, "accept failed: %E"); - -#ifdef AMIGA - if(!childs) - { - exit(1); - } -#endif - freez(csp_list); - continue; - } - else - { - log_error(LOG_LEVEL_CONNECT, - "accepted connection from %s on socket %d", - csp->ip_addr_str, csp->cfd); + bind_ports_helper(config, bfds); } #ifdef FEATURE_TOGGLE @@ -3479,7 +3597,8 @@ #ifdef FEATURE_ACL if (block_acl(NULL,csp)) { - log_error(LOG_LEVEL_CONNECT, "Connection from %s dropped due to ACL", csp->ip_addr_str); + log_error(LOG_LEVEL_CONNECT, + "Connection from %s on socket %d dropped due to ACL", csp->ip_addr_str, csp->cfd); close_socket(csp->cfd); freez(csp->ip_addr_str); freez(csp_list); @@ -3509,7 +3628,7 @@ { int child_id; -/* this is a switch () statment in the C preprocessor - ugh */ +/* this is a switch () statement in the C preprocessor - ugh */ #undef SELECTED_ONE_OPTION /* Use Pthreads in preference to native code */ @@ -3565,7 +3684,7 @@ #if defined(AMIGA) && !defined(SELECTED_ONE_OPTION) #define SELECTED_ONE_OPTION csp->cfd = ReleaseSocket(csp->cfd, -1); - + #ifdef __amigaos4__ child_id = (int)CreateNewProcTags(NP_Entry, (ULONG)server_thread, NP_Output, Output(), @@ -3606,7 +3725,7 @@ serve(csp); - /* + /* * If we've been toggled or we've blocked the request, tell Mom */ @@ -3617,7 +3736,7 @@ } #endif /* def FEATURE_TOGGLE */ -#ifdef FEATURE_STATISTICS +#ifdef FEATURE_STATISTICS if (csp->flags & CSP_FLAG_REJECTED) { rc |= RC_FLAG_BLOCKED; @@ -3637,7 +3756,7 @@ wait( &child_status ); - /* + /* * Evaluate child's return code: If the child has * - been toggled, toggle ourselves * - blocked its request, bump up the stats counter @@ -3656,7 +3775,7 @@ { urls_rejected++; } -#endif /* def FEATURE_STATISTICS */ +#endif /* def FEATURE_STATISTICS */ #endif /* !defined(_WIN32) && defined(__CYGWIN__) */ close_socket(csp->cfd); @@ -3722,7 +3841,6 @@ #if defined(unix) freez(basedir); #endif - freez(configfile); #if defined(_WIN32) && !defined(_WIN_CONSOLE) /* Cleanup - remove taskbar icon etc. */ diff -Nru privoxy-3.0.17/jcc.h privoxy-3.0.19/jcc.h --- privoxy-3.0.17/jcc.h 2010-07-21 14:35:09.000000000 +0000 +++ privoxy-3.0.19/jcc.h 2011-11-06 11:48:23.000000000 +0000 @@ -1,21 +1,21 @@ #ifndef JCC_H_INCLUDED #define JCC_H_INCLUDED -#define JCC_H_VERSION "$Id: jcc.h,v 1.29 2010/07/21 14:35:09 fabiankeil Exp $" +#define JCC_H_VERSION "$Id: jcc.h,v 1.32 2011/11/06 11:48:23 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.h,v $ * - * Purpose : Main file. Contains main() method, main loop, and + * Purpose : Main file. Contains main() method, main loop, and * the main connection-handling function. * * Copyright : Written by and Copyright (C) 2001-2006 the SourceForge * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/list.c privoxy-3.0.19/list.c --- privoxy-3.0.17/list.c 2009-07-23 15:08:11.000000000 +0000 +++ privoxy-3.0.19/list.c 2011-09-04 11:10:56.000000000 +0000 @@ -1,4 +1,4 @@ -const char list_rcs[] = "$Id: list.c,v 1.21 2009/05/16 13:27:20 fabiankeil Exp $"; +const char list_rcs[] = "$Id: list.c,v 1.25 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/list.c,v $ @@ -185,13 +185,13 @@ * Note that the 1000 limit was hit by a real user in tracker 911950; * removing it for now. Real circular references should eventually * be caught by the check above, anyway. - */ + */ /* if (entry > 1000) - { + { return 0; - } - */ + } + */ /* * Check this isn't marked as the last entry, unless of course it's @@ -496,7 +496,7 @@ assert(list_is_valid(the_list)); /* - * Calculate the lenght of the final text. + * Calculate the length of the final text. * '2' because of the '\r\n' at the end of * each string and at the end of the text. */ @@ -839,7 +839,7 @@ if (entry->str == NULL) { /* - * NULL pointers are allowed in some lists. + * NULL pointers are allowed in some lists. * For example for csp->headers in case a * header was removed. */ @@ -921,7 +921,7 @@ * * Note: Since all strings will be free()d in free_map() * later, set the copy flags for constants or - * strings that will be independantly free()d. + * strings that will be independently free()d. * * Note2: This function allows NULL parameters - it * returns JB_ERR_MEMORY in that case. @@ -1040,7 +1040,7 @@ assert(the_map); assert(name); - + last_entry = the_map->first; for (cur_entry = the_map->first; cur_entry != NULL; cur_entry = cur_entry->next) @@ -1060,13 +1060,13 @@ } /* - * Update the map's last pointer + * Update the map's last pointer */ if (cur_entry == the_map->last) { the_map->last = last_entry; } - + /* * Free the map_entry */ diff -Nru privoxy-3.0.17/list.h privoxy-3.0.19/list.h --- privoxy-3.0.17/list.h 2009-07-23 15:08:11.000000000 +0000 +++ privoxy-3.0.19/list.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef LIST_H_INCLUDED #define LIST_H_INCLUDED -#define LIST_H_VERSION "$Id: list.h,v 1.16 2009/05/16 13:27:20 fabiankeil Exp $" +#define LIST_H_VERSION "$Id: list.h,v 1.18 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/list.h,v $ @@ -13,10 +13,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/loadcfg.c privoxy-3.0.19/loadcfg.c --- privoxy-3.0.17/loadcfg.c 2010-08-15 08:10:15.000000000 +0000 +++ privoxy-3.0.19/loadcfg.c 2011-07-30 15:05:23.000000000 +0000 @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.111 2010/08/14 23:28:52 ler762 Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.121 2011/07/30 15:05:23 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $ @@ -133,12 +133,14 @@ #define hash_admin_address 4112573064ul /* "admin-address" */ #define hash_allow_cgi_request_crunching 258915987ul /* "allow-cgi-request-crunching" */ #define hash_buffer_limit 1881726070ul /* "buffer-limit */ +#define hash_compression_level 2464423563ul /* "compression-level" */ #define hash_confdir 1978389ul /* "confdir" */ #define hash_connection_sharing 1348841265ul /* "connection-sharing" */ #define hash_debug 78263ul /* "debug" */ #define hash_default_server_timeout 2530089913ul /* "default-server-timeout" */ #define hash_deny_access 1227333715ul /* "deny-access" */ #define hash_enable_edit_actions 2517097536ul /* "enable-edit-actions" */ +#define hash_enable_compression 3943696946ul /* "enable-compression" */ #define hash_enable_remote_toggle 2979744683ul /* "enable-remote-toggle" */ #define hash_enable_remote_http_toggle 110543988ul /* "enable-remote-http-toggle" */ #define hash_enforce_blocks 1862427469ul /* "enforce-blocks" */ @@ -227,7 +229,10 @@ freez(config->templdir); freez(config->hostname); - freez(config->haddr); + for (i = 0; i < MAX_LISTENING_SOCKETS; i++) + { + freez(config->haddr[i]); + } freez(config->logfile); for (i = 0; i < MAX_AF_FILES; i++) @@ -278,6 +283,51 @@ /********************************************************************* * + * Function : parse_toggle_value + * + * Description : Parse the value of a directive that can only be + * enabled or disabled. Terminates with a fatal error + * if the value is NULL or something other than 0 or 1. + * + * Parameters : + * 1 : name: The name of the directive. Used for log messages. + * 2 : value: The value to parse + * + * + * Returns : The numerical toggle state + * + *********************************************************************/ +static int parse_toggle_state(const char *name, const char *value) +{ + int toggle_state; + assert(name != NULL); + assert(value != NULL); + + if ((value == NULL) || (*value == '\0')) + { + log_error(LOG_LEVEL_FATAL, "Directive %s used without argument", name); + } + + toggle_state = atoi(value); + + /* + * Also check the length as atoi() doesn't mind + * garbage after a valid integer, but we do. + */ + if (((toggle_state != 0) && (toggle_state != 1)) || (strlen(value) != 1)) + { + log_error(LOG_LEVEL_FATAL, + "Directive %s used with invalid argument '%s'. Use either '0' or '1'.", + name, value); + } + + return toggle_state; + +} + + +/********************************************************************* + * * Function : load_config * * Description : Load the config file and all parameters. @@ -292,7 +342,7 @@ *********************************************************************/ struct configuration_spec * load_config(void) { - char buf[BUFFER_SIZE]; + char *buf = NULL; char *p, *q; FILE *configfp = NULL; struct configuration_spec * config = NULL; @@ -364,6 +414,13 @@ config->feature_flags &= ~RUNTIME_FEATURE_SPLIT_LARGE_FORMS; config->feature_flags &= ~RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS; config->feature_flags &= ~RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK; +#ifdef FEATURE_COMPRESSION + config->feature_flags &= ~RUNTIME_FEATURE_COMPRESSION; + /* + * XXX: Run some benchmarks to see if there are better default values. + */ + config->compression_level = 1; +#endif configfp = fopen(configfile, "r"); if (NULL == configfp) @@ -373,7 +430,7 @@ /* Never get here - LOG_LEVEL_FATAL causes program exit */ } - while (read_config_line(buf, sizeof(buf), configfp, &linenum) != NULL) + while (read_config_line(configfp, &linenum, &buf) != NULL) { char cmd[BUFFER_SIZE]; char arg[BUFFER_SIZE]; @@ -404,11 +461,15 @@ } /* Copy the argument into arg */ - strlcpy(arg, p, sizeof(arg)); + if (strlcpy(arg, p, sizeof(arg)) >= sizeof(arg)) + { + log_error(LOG_LEVEL_FATAL, "Config line too long: %s", buf); + } /* Should never happen, but check this anyway */ if (*cmd == '\0') { + freez(buf); continue; } @@ -449,7 +510,7 @@ * accept-intercepted-requests * *************************************************************************/ case hash_accept_intercepted_requests: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS; } @@ -471,7 +532,7 @@ * allow-cgi-request-crunching * *************************************************************************/ case hash_allow_cgi_request_crunching: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_CGI_CRUNCHING; } @@ -497,11 +558,37 @@ break; /* ************************************************************************* + * compression-level 0-9 + * *************************************************************************/ +#ifdef FEATURE_COMPRESSION + case hash_compression_level : + if (*arg != '\0') + { + int compression_level = atoi(arg); + if (-1 <= compression_level && compression_level <= 9) + { + config->compression_level = compression_level;; + } + else + { + log_error(LOG_LEVEL_FATAL, + "Invalid compression-level value: %s", arg); + } + } + else + { + log_error(LOG_LEVEL_FATAL, + "Invalid compression-level directive. Compression value missing"); + } + break; +#endif + +/* ************************************************************************* * connection-sharing (0|1) * *************************************************************************/ #ifdef FEATURE_CONNECTION_SHARING case hash_connection_sharing : - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_CONNECTION_SHARING; } @@ -628,7 +715,7 @@ * *************************************************************************/ #ifdef FEATURE_CGI_EDIT_ACTIONS case hash_enable_edit_actions: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_CGI_EDIT_ACTIONS; } @@ -640,11 +727,28 @@ #endif /* def FEATURE_CGI_EDIT_ACTIONS */ /* ************************************************************************* + * enable-compression 0|1 + * *************************************************************************/ +#ifdef FEATURE_COMPRESSION + case hash_enable_compression: + if (parse_toggle_state(cmd, arg) == 1) + { + config->feature_flags |= RUNTIME_FEATURE_COMPRESSION; + } + else + { + config->feature_flags &= ~RUNTIME_FEATURE_COMPRESSION; + } + break; +#endif /* def FEATURE_COMPRESSION */ + + +/* ************************************************************************* * enable-remote-toggle 0|1 * *************************************************************************/ #ifdef FEATURE_TOGGLE case hash_enable_remote_toggle: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_CGI_TOGGLE; } @@ -659,7 +763,7 @@ * enable-remote-http-toggle 0|1 * *************************************************************************/ case hash_enable_remote_http_toggle: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_HTTP_TOGGLE; } @@ -674,7 +778,7 @@ * *************************************************************************/ case hash_enforce_blocks: #ifdef FEATURE_FORCE_LOAD - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_ENFORCE_BLOCKS; } @@ -918,7 +1022,7 @@ * to the browser for blocked pages. ***************************************************************************/ case hash_handle_as_empty_returns_ok: - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK; } @@ -965,8 +1069,23 @@ * listen-address [ip][:port] * *************************************************************************/ case hash_listen_address : - freez(config->haddr); - config->haddr = strdup(arg); + i = 0; + while ((i < MAX_LISTENING_SOCKETS) && (NULL != config->haddr[i])) + { + i++; + } + + if (i >= MAX_LISTENING_SOCKETS) + { + log_error(LOG_LEVEL_FATAL, "Too many 'listen-address' directives in config file - limit is %d.\n" + "(You can increase this limit by changing MAX_LISTENING_SOCKETS in project.h and recompiling).", + MAX_LISTENING_SOCKETS); + } + config->haddr[i] = strdup(arg); + if (NULL == config->haddr[i]) + { + log_error(LOG_LEVEL_FATAL, "Out of memory while copying listening address"); + } break; /* ************************************************************************* @@ -1127,7 +1246,7 @@ * split-large-cgi-forms * *************************************************************************/ case hash_split_large_cgi_forms : - if ((*arg != '\0') && (0 != atoi(arg))) + if (parse_toggle_state(cmd, arg) == 1) { config->feature_flags |= RUNTIME_FEATURE_SPLIT_LARGE_FORMS; } @@ -1339,7 +1458,7 @@ /* Save the argument for the show-status page. */ savearg(cmd, arg, config); - + freez(buf); } /* end while ( read_config_line(...) ) */ fclose(configfp); @@ -1406,14 +1525,14 @@ log_error(LOG_LEVEL_FATAL, "Out of memory loading config - insufficient memory for config->proxy_args"); } - if (config->actions_file[0]) + if (config->re_filterfile[0]) { - add_loader(load_action_files, config); + add_loader(load_re_filterfiles, config); } - if (config->re_filterfile[0]) + if (config->actions_file[0]) { - add_loader(load_re_filterfiles, config); + add_loader(load_action_files, config); } #ifdef FEATURE_TRUST @@ -1423,39 +1542,45 @@ } #endif /* def FEATURE_TRUST */ - if ( NULL == config->haddr ) + if ( NULL == config->haddr[0] ) { - config->haddr = strdup( HADDR_DEFAULT ); + config->haddr[0] = strdup( HADDR_DEFAULT ); + if (NULL == config->haddr[0]) + { + log_error(LOG_LEVEL_FATAL, "Out of memory while copying default listening address"); + } } - if ( NULL != config->haddr ) + for (i = 0; i < MAX_LISTENING_SOCKETS && NULL != config->haddr[i]; i++) { - if ((*config->haddr == '[') - && (NULL != (p = strchr(config->haddr, ']'))) + if ((*config->haddr[i] == '[') + && (NULL != (p = strchr(config->haddr[i], ']'))) && (p[1] == ':') - && (0 < (config->hport = atoi(p + 2)))) + && (0 < (config->hport[i] = atoi(p + 2)))) { *p = '\0'; - memmove((void *)config->haddr, config->haddr + 1, - (size_t)(p - config->haddr)); + memmove((void *)config->haddr[i], config->haddr[i] + 1, + (size_t)(p - config->haddr[i])); } - else if (NULL != (p = strchr(config->haddr, ':')) - && (0 < (config->hport = atoi(p + 1)))) + else if (NULL != (p = strchr(config->haddr[i], ':')) + && (0 < (config->hport[i] = atoi(p + 1)))) { *p = '\0'; } else { - log_error(LOG_LEVEL_FATAL, "invalid bind port spec %s", config->haddr); + log_error(LOG_LEVEL_FATAL, "invalid bind port spec %s", config->haddr[i]); /* Never get here - LOG_LEVEL_FATAL causes program exit */ } - if (*config->haddr == '\0') + if (*config->haddr[i] == '\0') { /* - * Only the port specified. We stored it in config->hport + * Only the port specified. We stored it in config->hport[i] * and don't need its text representation anymore. + * Use config->hport[i] == 0 to iterate listening addresses since + * now. */ - freez(config->haddr); + freez(config->haddr[i]); } } @@ -1499,30 +1624,34 @@ struct configuration_spec * oldcfg = (struct configuration_spec *) current_configfile->f; /* - * Check if config->haddr,hport == oldcfg->haddr,hport + * Check if config->haddr[i],hport[i] == oldcfg->haddr[i],hport[i] * * The following could be written more compactly as a single, * (unreadably long) if statement. */ config->need_bind = 0; - if (config->hport != oldcfg->hport) - { - config->need_bind = 1; - } - else if (config->haddr == NULL) + + for (i = 0; i < MAX_LISTENING_SOCKETS; i++) { - if (oldcfg->haddr != NULL) + if (config->hport[i] != oldcfg->hport[i]) + { + config->need_bind = 1; + } + else if (config->haddr[i] == NULL) + { + if (oldcfg->haddr[i] != NULL) + { + config->need_bind = 1; + } + } + else if (oldcfg->haddr[i] == NULL) + { + config->need_bind = 1; + } + else if (0 != strcmp(config->haddr[i], oldcfg->haddr[i])) { config->need_bind = 1; } - } - else if (oldcfg->haddr == NULL) - { - config->need_bind = 1; - } - else if (0 != strcmp(config->haddr, oldcfg->haddr)) - { - config->need_bind = 1; } current_configfile->unloader = unload_configfile; diff -Nru privoxy-3.0.17/loadcfg.h privoxy-3.0.19/loadcfg.h --- privoxy-3.0.17/loadcfg.h 2009-09-10 14:45:17.000000000 +0000 +++ privoxy-3.0.19/loadcfg.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,12 +1,12 @@ #ifndef LOADCFG_H_INCLUDED #define LOADCFG_H_INCLUDED -#define LOADCFG_H_VERSION "$Id: loadcfg.h,v 1.15 2009/09/10 14:45:17 fabiankeil Exp $" +#define LOADCFG_H_VERSION "$Id: loadcfg.h,v 1.16 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.h,v $ * * Purpose : Loads settings from the configuration file into - * global variables. This file contains both the + * global variables. This file contains both the * routine to load the configuration and the global * variables it writes to. * @@ -14,10 +14,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/loaders.c privoxy-3.0.19/loaders.c --- privoxy-3.0.17/loaders.c 2010-07-21 14:35:09.000000000 +0000 +++ privoxy-3.0.19/loaders.c 2011-11-06 11:53:15.000000000 +0000 @@ -1,4 +1,4 @@ -const char loaders_rcs[] = "$Id: loaders.c,v 1.76 2010/07/21 14:35:09 fabiankeil Exp $"; +const char loaders_rcs[] = "$Id: loaders.c,v 1.87 2011/11/06 11:53:15 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loaders.c,v $ @@ -8,7 +8,7 @@ * the list of active loaders, and to automatically * unload files that are no longer in use. * - * Copyright : Written by and Copyright (C) 2001-2009 the + * Copyright : Written by and Copyright (C) 2001-2010 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -142,12 +142,12 @@ */ csp->config->config_file_list->active = 1; - /* + /* * Actions files */ for (i = 0; i < MAX_AF_FILES; i++) { - if (csp->actions_list[i]) + if (csp->actions_list[i]) { csp->actions_list[i]->active = 1; } @@ -158,7 +158,7 @@ */ for (i = 0; i < MAX_AF_FILES; i++) { - if (csp->rlist[i]) + if (csp->rlist[i]) { csp->rlist[i]->active = 1; } @@ -179,7 +179,7 @@ last_active = client_list; client_list = client_list->next; } - else + else /* * This client is not active. Free its resources. */ @@ -211,7 +211,7 @@ #endif /* def FEATURE_STATISTICS */ freez(client_list); - + client_list = last_active->next; } } @@ -359,7 +359,7 @@ p = buf; /* - * Character codes. If you have a wierd compiler and the following are + * Character codes. If you have a weird compiler and the following are * incorrect, you also need to fix NEWLINE() in loaders.h */ #define CHAR_CR '\r' /* ASCII 13 */ @@ -737,41 +737,27 @@ * and respects escaping of newline and comment char. * * Parameters : - * 1 : buf = Buffer to use. - * 2 : buflen = Size of buffer in bytes. - * 3 : fp = File to read from - * 4 : linenum = linenumber in file + * 1 : fp = File to read from + * 2 : linenum = linenumber in file + * 3 : buf = Pointer to a pointer to set to the data buffer. * * Returns : NULL on EOF or error * Otherwise, returns buf. * *********************************************************************/ -char *read_config_line(char *buf, size_t buflen, FILE *fp, unsigned long *linenum) +char *read_config_line(FILE *fp, unsigned long *linenum, char **buf) { jb_err err; - char *buf2 = NULL; - err = edit_read_line(fp, NULL, NULL, &buf2, NULL, linenum); + err = edit_read_line(fp, NULL, NULL, buf, NULL, linenum); if (err) { if (err == JB_ERR_MEMORY) { log_error(LOG_LEVEL_FATAL, "Out of memory loading a config file"); } - return NULL; - } - else - { - assert(buf2); - if (strlen(buf2) + 1U > buflen) - { - log_error(LOG_LEVEL_FATAL, - "Max line limit reached. Linenumber: %u. Lenght: %u. Max lenght: %u.", - *linenum, strlen(buf2), buflen-1); - } - strlcpy(buf, buf2, buflen); - free(buf2); - return buf; + *buf = NULL; } + return *buf; } @@ -849,7 +835,7 @@ struct block_spec *b, *bl; struct url_spec **tl; - char buf[BUFFER_SIZE], *p, *q; + char *buf = NULL; int reject, trusted; struct file_list *fs; unsigned long linenum = 0; @@ -858,10 +844,7 @@ if (!check_file_changed(current_trustfile, csp->config->trustfile, &fs)) { /* No need to load */ - if (csp) - { - csp->tlist = current_trustfile; - } + csp->tlist = current_trustfile; return(0); } if (!fs) @@ -883,7 +866,7 @@ tl = csp->config->trust_list; - while (read_config_line(buf, sizeof(buf), fp, &linenum) != NULL) + while (read_config_line(fp, &linenum, &buf) != NULL) { trusted = 0; reject = 1; @@ -896,6 +879,9 @@ if (*buf == '~') { + char *p; + char *q; + reject = 0; p = buf; q = p+1; @@ -908,6 +894,7 @@ /* skip blank lines */ if (*buf == '\0') { + freez(buf); continue; } @@ -941,9 +928,10 @@ *tl++ = b->url; } } + freez(buf); } - if(trusted_referrers >= MAX_TRUSTED_REFERRERS) + if(trusted_referrers >= MAX_TRUSTED_REFERRERS) { /* * FIXME: ... after Privoxy 3.0.4 is out. @@ -967,17 +955,14 @@ fs->next = files->next; files->next = fs; current_trustfile = fs; - - if (csp) - { - csp->tlist = fs; - } + csp->tlist = fs; return(0); load_trustfile_error: log_error(LOG_LEVEL_FATAL, "can't load trustfile '%s': %E", - csp->config->trustfile); + csp->config->trustfile); + freez(buf); return(-1); } @@ -1021,7 +1006,7 @@ * * Function : unload_forward_spec * - * Description : Unload the forward spec settings by freeing all + * Description : Unload the forward spec settings by freeing all * memory referenced by members and the memory for * the spec itself. * @@ -1075,7 +1060,7 @@ * * Function : load_re_filterfiles * - * Description : Loads all the filterfiles. + * Description : Loads all the filterfiles. * Generate a chained list of re_filterfile_spec's from * the "FILTER: " blocks, compiling all their substitutions * into chained lists of pcrs_job structs. @@ -1116,7 +1101,7 @@ * * Function : load_one_re_filterfile * - * Description : Load a re_filterfile. + * Description : Load a re_filterfile. * Generate a chained list of re_filterfile_spec's from * the "FILTER: " blocks, compiling all their substitutions * into chained lists of pcrs_job structs. @@ -1134,7 +1119,7 @@ struct re_filterfile_spec *new_bl, *bl = NULL; struct file_list *fs; - char buf[BUFFER_SIZE]; + char *buf = NULL; int error; unsigned long linenum = 0; pcrs_job *dummy, *lastjob = NULL; @@ -1144,10 +1129,7 @@ */ if (!check_file_changed(current_re_filterfile[fileid], csp->config->re_filterfile[fileid], &fs)) { - if (csp) - { - csp->rlist[fileid] = current_re_filterfile[fileid]; - } + csp->rlist[fileid] = current_re_filterfile[fileid]; return(0); } if (!fs) @@ -1155,7 +1137,7 @@ goto load_re_filterfile_error; } - /* + /* * Open the file or fail */ if ((fp = fopen(csp->config->re_filterfile[fileid], "r")) == NULL) @@ -1165,10 +1147,10 @@ log_error(LOG_LEVEL_INFO, "Loading filter file: %s", csp->config->re_filterfile[fileid]); - /* + /* * Read line by line */ - while (read_config_line(buf, sizeof(buf), fp, &linenum) != NULL) + while (read_config_line(fp, &linenum, &buf) != NULL) { int new_filter = NO_NEW_FILTER; @@ -1233,7 +1215,7 @@ } new_bl->name = strdup(chomp(new_bl->name)); - + /* * If this is the first filter block, chain it * to the file_list rather than its (nonexistant) @@ -1252,12 +1234,13 @@ log_error(LOG_LEVEL_RE_FILTER, "Reading in filter \"%s\" (\"%s\")", bl->name, bl->description); + freez(buf); continue; } - /* + /* * Else, save the expression, make it a pcrs_job - * and chain it into the current filter's joblist + * and chain it into the current filter's joblist */ if (bl != NULL) { @@ -1283,7 +1266,8 @@ bl->dynamic = 1; log_error(LOG_LEVEL_RE_FILTER, "Adding dynamic re_filter job \'%s\' to filter %s succeeded.", buf, bl->name); - continue; + freez(buf); + continue; } else if (bl->dynamic) { @@ -1294,6 +1278,7 @@ */ log_error(LOG_LEVEL_RE_FILTER, "Adding static re_filter job \'%s\' to dynamic filter %s succeeded.", buf, bl->name); + freez(buf); continue; } @@ -1301,6 +1286,7 @@ { log_error(LOG_LEVEL_ERROR, "Adding re_filter job \'%s\' to filter %s failed with error %d.", buf, bl->name, error); + freez(buf); continue; } else @@ -1322,11 +1308,12 @@ log_error(LOG_LEVEL_ERROR, "Ignoring job %s outside filter block in %s, line %d", buf, csp->config->re_filterfile[fileid], linenum); } + freez(buf); } fclose(fp); - /* + /* * Schedule the now-obsolete old data for unloading */ if ( NULL != current_re_filterfile[fileid] ) @@ -1340,11 +1327,7 @@ fs->next = files->next; files->next = fs; current_re_filterfile[fileid] = fs; - - if (csp) - { - csp->rlist[fileid] = fs; - } + csp->rlist[fileid] = fs; return( 0 ); @@ -1376,7 +1359,7 @@ { int i; - for (i=0; i < NLOADERS; i++) + for (i = 0; i < NLOADERS; i++) { if (config->loaders[i] == NULL) { @@ -1410,7 +1393,7 @@ int ret = 0; int i; - for (i=0; i < NLOADERS; i++) + for (i = 0; i < NLOADERS; i++) { if (csp->config->loaders[i] == NULL) { @@ -1422,6 +1405,66 @@ } +/********************************************************************* + * + * Function : file_has_been_modified + * + * Description : Helper function to check if a file has been changed + * + * Parameters : + * 1 : filename = The name of the file to check + * 2 : last_known_modification = The time of the last known + * modification + * + * Returns : TRUE if the file has been changed, + * FALSE otherwise. + * + *********************************************************************/ +static int file_has_been_modified(const char *filename, time_t last_know_modification) +{ + struct stat statbuf[1]; + + if (stat(filename, statbuf) < 0) + { + /* Error, probably file not found which counts as change. */ + return 1; + } + + return (last_know_modification != statbuf->st_mtime); +} + + +/********************************************************************* + * + * Function : any_loaded_file_changed + * + * Description : Helper function to check if any loaded file has been + * changed since the time it has been loaded. + * + * XXX: Should we cache the return value for x seconds? + * + * Parameters : + * 1 : files_to_check = List of files to check + * + * Returns : TRUE if any file has been changed, + * FALSE otherwise. + * + *********************************************************************/ +int any_loaded_file_changed(const struct file_list *files_to_check) +{ + const struct file_list *file_to_check = files_to_check; + + while (file_to_check != NULL) + { + if (file_has_been_modified(file_to_check->filename, file_to_check->lastmodified)) + { + return TRUE; + } + file_to_check = file_to_check->next; + } + return FALSE; +} + /* Local Variables: diff -Nru privoxy-3.0.17/loaders.h privoxy-3.0.19/loaders.h --- privoxy-3.0.17/loaders.h 2009-06-21 19:21:14.000000000 +0000 +++ privoxy-3.0.19/loaders.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,23 +1,23 @@ #ifndef LOADERS_H_INCLUDED #define LOADERS_H_INCLUDED -#define LOADERS_H_VERSION "$Id: loaders.h,v 1.25 2009/05/16 13:27:20 fabiankeil Exp $" +#define LOADERS_H_VERSION "$Id: loaders.h,v 1.29 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loaders.h,v $ * * Purpose : Functions to load and unload the various * configuration files. Also contains code to manage - * the list of active loaders, and to automatically + * the list of active loaders, and to automatically * unload files that are no longer in use. * - * Copyright : Written by and Copyright (C) 2001-2009 the + * Copyright : Written by and Copyright (C) 2001-2010 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -49,7 +49,7 @@ struct url_spec; extern unsigned int sweep(void); -extern char *read_config_line(char *buf, size_t buflen, FILE *fp, unsigned long *linenum); +extern char *read_config_line(FILE *fp, unsigned long *linenum, char **buf); extern int check_file_changed(const struct file_list * current, const char * filename, struct file_list ** newfl); @@ -73,7 +73,7 @@ /* * Types of newlines that a file may contain, as strings. If you have an - * extremely wierd compiler that does not have '\r' == CR == ASCII 13 and + * extremely weird compiler that does not have '\r' == CR == ASCII 13 and * '\n' == LF == ASCII 10), then fix CHAR_CR and CHAR_LF in loaders.c as * well as these definitions. */ @@ -98,10 +98,12 @@ void unload_forward_spec(struct forward_spec *fwd); -extern void add_loader(int (*loader)(struct client_state *), +extern void add_loader(int (*loader)(struct client_state *), struct configuration_spec * config); extern int run_loader(struct client_state *csp); +extern int any_loaded_file_changed(const struct file_list *files_to_check); + /* Revision control strings from this header and associated .c file */ extern const char loaders_rcs[]; extern const char loaders_h_rcs[]; diff -Nru privoxy-3.0.17/miscutil.c privoxy-3.0.19/miscutil.c --- privoxy-3.0.17/miscutil.c 2009-06-21 19:21:14.000000000 +0000 +++ privoxy-3.0.19/miscutil.c 2011-09-04 11:10:56.000000000 +0000 @@ -1,19 +1,18 @@ -const char miscutil_rcs[] = "$Id: miscutil.c,v 1.64 2009/05/19 17:45:31 fabiankeil Exp $"; +const char miscutil_rcs[] = "$Id: miscutil.c,v 1.68 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $ * - * Purpose : zalloc, hash_string, safe_strerror, strcmpic, - * strncmpic, chomp, and MinGW32 strdup - * functions. - * These are each too small to deserve their own file - * but don't really fit in any other file. + * Purpose : zalloc, hash_string, strcmpic, strncmpic, and + * MinGW32 strdup functions. These are each too small + * to deserve their own file but don't really fit in + * any other file. * - * Copyright : Written by and Copyright (C) 2001-2007 - * the SourceForge Privoxy team. http://www.privoxy.org/ + * Copyright : Written by and Copyright (C) 2001-2011 the + * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * * The timegm replacement function was taken from GnuPG, @@ -24,7 +23,7 @@ * used under the terms of the GPL or the terms of the * "Frontier Artistic License". * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -98,19 +97,19 @@ #if defined(unix) /********************************************************************* * - * Function : write_pid_file + * Function : write_pid_file * - * Description : Writes a pid file with the pid of the main process + * Description : Writes a pid file with the pid of the main process * * Parameters : None * - * Returns : N/A + * Returns : N/A * *********************************************************************/ void write_pid_file(void) { FILE *fp; - + /* * If no --pidfile option was given, * we can live without one. @@ -148,7 +147,7 @@ *********************************************************************/ unsigned int hash_string( const char* s ) { - unsigned int h = 0; + unsigned int h = 0; for ( ; *s; ++s ) { @@ -160,75 +159,6 @@ } -#ifdef __MINGW32__ -/********************************************************************* - * - * Function : strdup - * - * Description : For some reason (which is beyond me), gcc and WIN32 - * don't like strdup. When a "free" is executed on a - * strdup'd ptr, it can at times freez up! So I just - * replaced it and problem was solved. - * - * Parameters : - * 1 : s = string to duplicate - * - * Returns : Pointer to newly malloc'ed copy of the string. - * - *********************************************************************/ -char *strdup( const char *s ) -{ - char * result = (char *)malloc( strlen(s)+1 ); - - if (result != NULL) - { - strcpy( result, s ); - } - - return( result ); -} - -#endif /* def __MINGW32__ */ - - - -/********************************************************************* - * - * Function : safe_strerror - * - * Description : Variant of the library routine strerror() which will - * work on systems without the library routine, and - * which should never return NULL. - * - * Parameters : - * 1 : err = the `errno' of the last operation. - * - * Returns : An "English" string of the last `errno'. Allocated - * with strdup(), so caller frees. May be NULL if the - * system is out of memory. - * - *********************************************************************/ -char *safe_strerror(int err) -{ - char *s = NULL; - char buf[BUFFER_SIZE]; - - -#ifdef HAVE_STRERROR - s = strerror(err); -#endif /* HAVE_STRERROR */ - - if (s == NULL) - { - snprintf(buf, sizeof(buf), "(errno = %d)", err); - s = buf; - } - - return(strdup(s)); - -} - - /********************************************************************* * * Function : strcmpic @@ -264,7 +194,7 @@ * * Function : strncmpic * - * Description : Case insensitive string comparison (upto n characters) + * Description : Case insensitive string comparison (up to n characters) * * Parameters : * 1 : s1 = string 1 to compare @@ -279,7 +209,7 @@ if (n <= (size_t)0) return(0); if (!s1) s1 = ""; if (!s2) s2 = ""; - + while (*s1 && *s2) { if ( ( *s1 != *s2 ) && ( ijb_tolower(*s1) != ijb_tolower(*s2) ) ) @@ -313,7 +243,7 @@ { char *p, *q, *r; - /* + /* * strip trailing whitespace */ p = string + strlen(string); @@ -323,8 +253,8 @@ } *p = '\0'; - /* - * find end of leading whitespace + /* + * find end of leading whitespace */ q = r = string; while (*q && ijb_isspace(*q)) @@ -352,7 +282,7 @@ * * Function : string_append * - * Description : Reallocate target_string and append text to it. + * Description : Reallocate target_string and append text to it. * This makes it easier to append to malloc'd strings. * This is similar to the (removed) strsav(), but * running out of memory isn't catastrophic. @@ -497,7 +427,7 @@ * Parameters : * 1 : string = string to convert * - * Returns : Uppercase copy of string if possible, + * Returns : Uppercase copy of string if possible, * NULL on out-of-memory or if string was NULL. * *********************************************************************/ @@ -510,7 +440,7 @@ { return NULL; } - + q = string; p = result; @@ -560,11 +490,11 @@ * * Function : make_path * - * Description : Takes a directory name and a file name, returns + * Description : Takes a directory name and a file name, returns * the complete path. Handles windows/unix differences. * If the file name is already an absolute path, or if - * the directory name is NULL or empty, it returns - * the filename. + * the directory name is NULL or empty, it returns + * the filename. * * Parameters : * 1 : dir: Name of directory or NULL for none. @@ -573,7 +503,7 @@ * Returns : "dir/file" (Or on windows, "dir\file"). * It allocates the string on the heap. Caller frees. * Returns NULL in error (i.e. NULL file or out of - * memory) + * memory) * *********************************************************************/ char * make_path(const char * dir, const char * file) @@ -686,7 +616,7 @@ * Parameters : * 1 : range: Highest possible number to pick. * - * Returns : Picked number. + * Returns : Picked number. * *********************************************************************/ long int pick_from_range(long int range) @@ -702,7 +632,7 @@ if (range <= 0) return 0; #ifdef HAVE_RANDOM - number = random() % range + 1; + number = random() % range + 1; #elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&rand_mutex); #ifdef _WIN32 @@ -806,7 +736,7 @@ * Parameters : * 1 : tm: Broken-down time struct. * - * Returns : tm converted into time_t seconds. + * Returns : tm converted into time_t seconds. * *********************************************************************/ time_t timegm(struct tm *tm) @@ -858,7 +788,7 @@ snprintf.c - a portable implementation of snprintf, including vsnprintf.c, asnprintf, vasnprintf, asprintf, vasprintf - + snprintf is a routine to convert numeric and string arguments to formatted strings. It is similar to sprintf(3) provided in a system's C library, yet it requires an additional argument - the buffer size - @@ -1500,7 +1430,7 @@ } } /* zero padding to specified precision? */ - if (num_of_digits < precision) + if (num_of_digits < precision) number_of_zeros_to_pad = precision - num_of_digits; } /* zero padding to specified minimal field width? */ @@ -1518,7 +1448,7 @@ #if defined(PERL_COMPATIBLE) || defined(LINUX_COMPATIBLE) /* keep the entire format string unchanged */ str_arg = starting_p; str_arg_l = p - starting_p; - /* well, not exactly so for Linux, which does something inbetween, + /* well, not exactly so for Linux, which does something between, * and I don't feel an urge to imitate it: "%+++++hy" -> "%+y" */ #else /* discard the unrecognized conversion, just keep * diff -Nru privoxy-3.0.17/miscutil.h privoxy-3.0.19/miscutil.h --- privoxy-3.0.17/miscutil.h 2009-06-21 19:21:14.000000000 +0000 +++ privoxy-3.0.19/miscutil.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,23 +1,23 @@ #ifndef MISCUTIL_H_INCLUDED #define MISCUTIL_H_INCLUDED -#define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.31 2009/05/16 13:27:20 fabiankeil Exp $" +#define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.34 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/miscutil.h,v $ * - * Purpose : zalloc, hash_string, safe_strerror, strcmpic, - * strncmpic, and MinGW32 strdup functions. These are - * each too small to deserve their own file but don't - * really fit in any other file. + * Purpose : zalloc, hash_string, strcmpic, strncmpic, and + * MinGW32 strdup functions. These are each too small + * to deserve their own file but don't really fit in + * any other file. * - * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -53,8 +53,6 @@ extern unsigned int hash_string(const char* s); -extern char *safe_strerror(int err); - extern int strcmpic(const char *s1, const char *s2); extern int strncmpic(const char *s1, const char *s2, size_t n); @@ -69,10 +67,6 @@ long int pick_from_range(long int range); -#ifdef __MINGW32__ -extern char *strdup(const char *s); -#endif /* def __MINGW32__ */ - #ifndef HAVE_SNPRINTF extern int snprintf(char *, size_t, const char *, /*args*/ ...); #endif /* ndef HAVE_SNPRINTF */ diff -Nru privoxy-3.0.17/parsers.c privoxy-3.0.19/parsers.c --- privoxy-3.0.17/parsers.c 2010-06-13 12:26:32.000000000 +0000 +++ privoxy-3.0.19/parsers.c 2011-11-06 11:36:27.000000000 +0000 @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.214 2010/06/13 12:26:32 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.237 2011/11/06 11:36:27 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -152,6 +152,9 @@ static jb_err crunch_server_header (struct client_state *csp, char **header); static jb_err server_last_modified (struct client_state *csp, char **header); static jb_err server_content_disposition(struct client_state *csp, char **header); +#ifdef FEATURE_ZLIB +static jb_err server_adjust_content_encoding(struct client_state *csp, char **header); +#endif #ifdef FEATURE_CONNECTION_KEEP_ALIVE static jb_err server_save_content_length(struct client_state *csp, char **header); @@ -184,10 +187,10 @@ { /** The header prefix to match */ const char *str; - + /** The length of the prefix to match */ const size_t len; - + /** The function to apply to this line */ const parser_func_ptr parser; }; @@ -249,7 +252,6 @@ client_host_adder, client_x_forwarded_for_adder, client_xtra_adder, - /* Temporarily disabled: client_accept_encoding_adder, */ client_connection_header_adder, NULL }; @@ -347,7 +349,7 @@ { want *= 2; } - + if (want <= csp->config->buffer_limit && NULL != (p = (char *)realloc(iob->buf, want))) { iob->size = want; @@ -403,7 +405,7 @@ jb_err decompress_iob(struct client_state *csp) { char *buf; /* new, uncompressed buffer */ - char *cur; /* Current iob position (to keep the original + char *cur; /* Current iob position (to keep the original * iob->cur unmodified if we return early) */ size_t bufsize; /* allocated size of the new buffer */ size_t old_size; /* Content size before decompression */ @@ -551,7 +553,7 @@ * * Fortunately, add_to_iob() has thoughtfully null-terminated * the buffer; we can just increment the end pointer to include - * the dummy byte. + * the dummy byte. */ csp->iob->eod++; } @@ -616,10 +618,12 @@ } /* - * If we tried the limit and still didn't have enough - * memory, just give up. + * If we reached the buffer limit and still didn't have enough + * memory, just give up. Due to the ceiling enforced by the next + * if block we could actually check for equality here, but as it + * can be easily mistaken for a bug we don't. */ - if (bufsize == csp->config->buffer_limit) + if (bufsize >= csp->config->buffer_limit) { log_error(LOG_LEVEL_ERROR, "Buffer limit reached while decompressing iob"); return JB_ERR_MEMORY; @@ -633,7 +637,7 @@ { bufsize = csp->config->buffer_limit; } - + /* Try to allocate the new buffer. */ tmpbuf = realloc(buf, bufsize); if (NULL == tmpbuf) @@ -705,7 +709,7 @@ csp->iob->cur = csp->iob->buf + skip_size; csp->iob->eod = (char *)zstr.next_out; csp->iob->size = bufsize; - + /* * Make sure the new uncompressed iob obeys some minimal * consistency conditions. @@ -877,7 +881,7 @@ * Header spans multiple lines, append the next one. */ char *continued_header; - + continued_header = get_header_line(iob); if ((continued_header == NULL) || (*continued_header == '\0')) { @@ -1009,7 +1013,7 @@ } } - /* + /* * Not found */ return NULL; @@ -1021,7 +1025,7 @@ * * Function : scan_headers * - * Description : Scans headers, applies tags and updates action bits. + * Description : Scans headers, applies tags and updates action bits. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) @@ -1137,7 +1141,7 @@ { "Content-Length:", 15, server_adjust_content_length }, { "Transfer-Encoding:", 18, server_transfer_coding }, #ifdef FEATURE_ZLIB - { "Content-Encoding:", 17, server_content_encoding }, + { "Content-Encoding:", 17, server_adjust_content_encoding }, #endif /* def FEATURE_ZLIB */ { NULL, 0, NULL } }; @@ -1182,6 +1186,18 @@ } #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ +#ifdef FEATURE_COMPRESSION + if ((JB_ERR_OK == err) + && (csp->flags & CSP_FLAG_BUFFERED_CONTENT_DEFLATED)) + { + err = enlist_unique_header(csp->headers, "Content-Encoding", "deflate"); + if (JB_ERR_OK == err) + { + log_error(LOG_LEVEL_HEADER, "Added header: Content-Encoding: deflate"); + } + } +#endif + return err; } @@ -1327,7 +1343,7 @@ b->name); continue; } - + if (!list_contains_item(csp->tags, tag)) { if (JB_ERR_OK != enlist(csp->tags, tag)) @@ -1491,7 +1507,7 @@ matches = pcrs_execute(job, *header, size, &newheader, &size); if ( 0 < matches ) { - current_hits += matches; + current_hits += matches; log_error(LOG_LEVEL_HEADER, "Transforming \"%s\" to \"%s\"", *header, newheader); freez(*header); *header = newheader; @@ -1805,7 +1821,7 @@ * Function : client_connection * * Description : Makes sure a proper "Connection:" header is - * set and signals connection_header_adder + * set and signals connection_header_adder * to do nothing. * * Parameters : @@ -1833,6 +1849,11 @@ log_error(LOG_LEVEL_HEADER, "Removing \'%s\' to imply keep-alive.", *header); freez(*header); + /* + * While we imply keep-alive to the server, + * we have to remember that the client didn't. + */ + csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; } else { @@ -1942,7 +1963,7 @@ /* Is the current header the lucky one? */ if (strstr(*header, crunch_pattern)) { - log_error(LOG_LEVEL_HEADER, "Crunching server header: %s (contains: %s)", *header, crunch_pattern); + log_error(LOG_LEVEL_HEADER, "Crunching server header: %s (contains: %s)", *header, crunch_pattern); freez(*header); } } @@ -1956,7 +1977,7 @@ * Function : server_content_type * * Description : Set the content-type for filterable types (text/.*, - * .*xml.*, javascript and image/gif) unless filtering has been + * .*xml.*, .*script.* and image/gif) unless filtering has been * forbidden (CT_TABOO) while parsing earlier headers. * NOTE: Since text/plain is commonly used by web servers * for files whose correct type is unknown, we don't @@ -2006,7 +2027,7 @@ */ if ((strstr(*header, "text/") && !strstr(*header, "plain")) || strstr(*header, "xml") - || strstr(*header, "application/x-javascript")) + || strstr(*header, "script")) { csp->content_type |= CT_TEXT; } @@ -2022,8 +2043,8 @@ if (csp->action->flags & ACTION_CONTENT_TYPE_OVERWRITE) { /* - * Make sure the user doesn't accidently - * change the content type of binary documents. + * Make sure the user doesn't accidentally + * change the content type of binary documents. */ if ((csp->content_type & CT_TEXT) || (csp->action->flags & ACTION_FORCE_TEXT_MODE)) { @@ -2116,16 +2137,16 @@ * * Function : server_content_encoding * - * Description : This function is run twice for each request, - * unless FEATURE_ZLIB and filtering are disabled. - * - * The first run is used to check if the content - * is compressed, if FEATURE_ZLIB is disabled - * filtering is then disabled as well, if FEATURE_ZLIB - * is enabled the content is marked for decompression. - * - * The second run is used to remove the Content-Encoding - * header if the decompression was successful. + * Description : Used to check if the content is compressed, and if + * FEATURE_ZLIB is disabled, filtering is disabled as + * well. + * + * If FEATURE_ZLIB is enabled and the compression type + * supported, the content is marked for decompression. + * + * XXX: Doesn't properly deal with multiple or with + * unsupported but unknown encodings. + * Is case-sensitive but shouldn't be. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) @@ -2141,19 +2162,25 @@ static jb_err server_content_encoding(struct client_state *csp, char **header) { #ifdef FEATURE_ZLIB - if ((csp->flags & CSP_FLAG_MODIFIED) - && (csp->content_type & (CT_GZIP | CT_DEFLATE))) + if (strstr(*header, "sdch")) { /* - * We successfully decompressed the content, - * and have to clean the header now, so the - * client no longer expects compressed data.. - * - * XXX: There is a difference between cleaning - * and removing it completely. + * Shared Dictionary Compression over HTTP isn't supported, + * filtering it anyway is pretty much guaranteed to mess up + * the encoding. */ - log_error(LOG_LEVEL_HEADER, "Crunching: %s", *header); - freez(*header); + csp->content_type |= CT_TABOO; + + /* + * Log a warning if the user expects the content to be filtered. + */ + if ((csp->rlist != NULL) && + (!list_is_empty(csp->action->multi[ACTION_MULTI_FILTER]))) + { + log_error(LOG_LEVEL_INFO, + "SDCH-compressed content detected, content filtering disabled. " + "Consider suppressing SDCH offers made by the client."); + } } else if (strstr(*header, "gzip")) { @@ -2174,7 +2201,16 @@ csp->content_type |= CT_TABOO; } #else /* !defined(FEATURE_ZLIB) */ - if (strstr(*header, "gzip") || strstr(*header, "compress") || strstr(*header, "deflate")) + /* + * XXX: Using a black list here isn't the right approach. + * + * In case of SDCH, building with zlib support isn't + * going to help. + */ + if (strstr(*header, "gzip") || + strstr(*header, "compress") || + strstr(*header, "deflate") || + strstr(*header, "sdch")) { /* * Body is compressed, turn off pcrs and gif filtering. @@ -2200,6 +2236,49 @@ } +#ifdef FEATURE_ZLIB +/********************************************************************* + * + * Function : server_adjust_content_encoding + * + * Description : Remove the Content-Encoding header if the + * decompression was successful and the content + * has been modifed. + * + * Parameters : + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : header = On input, pointer to header to modify. + * On output, pointer to the modified header, or NULL + * to remove the header. This function frees the + * original string if necessary. + * + * Returns : JB_ERR_OK on success, or + * JB_ERR_MEMORY on out-of-memory error. + * + *********************************************************************/ +static jb_err server_adjust_content_encoding(struct client_state *csp, char **header) +{ + if ((csp->flags & CSP_FLAG_MODIFIED) + && (csp->content_type & (CT_GZIP | CT_DEFLATE))) + { + /* + * We successfully decompressed the content, + * and have to clean the header now, so the + * client no longer expects compressed data. + * + * XXX: There is a difference between cleaning + * and removing it completely. + */ + log_error(LOG_LEVEL_HEADER, "Crunching: %s", *header); + freez(*header); + } + + return JB_ERR_OK; + +} +#endif /* defined(FEATURE_ZLIB) */ + + /********************************************************************* * * Function : server_adjust_content_length @@ -2353,7 +2432,7 @@ return JB_ERR_OK; } else - { + { /* * Replacing Content-Disposition header */ @@ -2393,15 +2472,9 @@ static jb_err server_last_modified(struct client_state *csp, char **header) { const char *newval; - char buf[BUFFER_SIZE]; - + time_t last_modified; char newheader[50]; -#ifdef HAVE_GMTIME_R - struct tm gmt; -#endif - struct tm *timeptr = NULL; - time_t now, last_modified; - + /* * Are we messing with the Last-Modified header? */ @@ -2423,18 +2496,19 @@ return JB_ERR_OK; } else if (0 == strcmpic(newval, "reset-to-request-time")) - { + { /* * Setting Last-Modified Header to now. */ + char buf[30]; get_http_time(0, buf, sizeof(buf)); freez(*header); *header = strdup("Last-Modified: "); - string_append(header, buf); + string_append(header, buf); if (*header == NULL) { - log_error(LOG_LEVEL_HEADER, "Insufficient memory. Last-Modified header got lost, boohoo."); + log_error(LOG_LEVEL_HEADER, "Insufficient memory. Last-Modified header got lost, boohoo."); } else { @@ -2446,16 +2520,7 @@ const char *header_time = *header + sizeof("Last-Modified:"); log_error(LOG_LEVEL_HEADER, "Randomizing: %s", *header); - now = time(NULL); -#ifdef HAVE_GMTIME_R - gmtime_r(&now, &gmt); -#elif defined(MUTEX_LOCKS_AVAILABLE) - privoxy_mutex_lock(&gmtime_mutex); - gmtime(&now); - privoxy_mutex_unlock(&gmtime_mutex); -#else - gmtime(&now); -#endif + if (JB_ERR_OK != parse_header_time(header_time, &last_modified)) { log_error(LOG_LEVEL_HEADER, "Couldn't parse: %s in %s (crunching!)", header_time, *header); @@ -2463,7 +2528,14 @@ } else { - long int rtime = (long int)difftime(now, last_modified); + time_t now; + struct tm *timeptr = NULL; + long int rtime; +#ifdef HAVE_GMTIME_R + struct tm gmt; +#endif + now = time(NULL); + rtime = (long int)difftime(now, last_modified); if (rtime) { long int days, hours, minutes, seconds; @@ -2471,7 +2543,7 @@ if (negative_delta) { - rtime *= -1; + rtime *= -1; log_error(LOG_LEVEL_HEADER, "Server time in the future."); } rtime = pick_from_range(rtime); @@ -2506,7 +2578,7 @@ if (*header == NULL) { log_error(LOG_LEVEL_ERROR, "Insufficient memory, header crunched without replacement."); - return JB_ERR_MEMORY; + return JB_ERR_MEMORY; } days = rtime / (3600 * 24); @@ -2551,25 +2623,17 @@ *********************************************************************/ static jb_err client_accept_encoding(struct client_state *csp, char **header) { +#ifdef FEATURE_COMPRESSION + if ((csp->config->feature_flags & RUNTIME_FEATURE_COMPRESSION) + && strstr(*header, "deflate")) + { + csp->flags |= CSP_FLAG_CLIENT_SUPPORTS_DEFLATE; + } +#endif if ((csp->action->flags & ACTION_NO_COMPRESSION) != 0) { log_error(LOG_LEVEL_HEADER, "Suppressed offer to compress content"); - freez(*header); - - /* Temporarily disable the correct behaviour to - * work around a PHP bug. - * - * if (!strcmpic(csp->http->ver, "HTTP/1.1")) - * { - * *header = strdup("Accept-Encoding: identity;q=1.0, *;q=0"); - * if (*header == NULL) - * { - * return JB_ERR_MEMORY; - * } - * } - * - */ } return JB_ERR_OK; @@ -2630,7 +2694,7 @@ /* booleans for parameters we have to check multiple times */ int parameter_conditional_block; int parameter_conditional_forge; - + #ifdef FEATURE_FORCE_LOAD /* * Since the referrer can include the prefix even @@ -2728,18 +2792,18 @@ return JB_ERR_OK; } else - { + { /* * Replacing Accept-Language header */ freez(*header); *header = strdup("Accept-Language: "); - string_append(header, newval); + string_append(header, newval); if (*header == NULL) { log_error(LOG_LEVEL_ERROR, - "Insufficient memory. Accept-Language header crunched without replacement."); + "Insufficient memory. Accept-Language header crunched without replacement."); } else { @@ -2780,7 +2844,7 @@ /* Is the current header the lucky one? */ if (strstr(*header, crunch_pattern)) { - log_error(LOG_LEVEL_HEADER, "Crunching client header: %s (contains: %s)", *header, crunch_pattern); + log_error(LOG_LEVEL_HEADER, "Crunching client header: %s (contains: %s)", *header, crunch_pattern); freez(*header); } } @@ -3085,10 +3149,10 @@ return JB_ERR_OK; } - if (!csp->http->hostport || (*csp->http->hostport == '*') || + if (!csp->http->hostport || (*csp->http->hostport == '*') || *csp->http->hostport == ' ' || *csp->http->hostport == '\0') { - + if (NULL == (p = strdup((*header)+6))) { return JB_ERR_MEMORY; @@ -3151,13 +3215,13 @@ struct tm gmt; #endif struct tm *timeptr = NULL; - time_t tm = 0; + time_t tm = 0; const char *newval; char * endptr; - + if ( 0 == strcmpic(*header, "If-Modified-Since: Wed, 08 Jun 1955 12:00:00 GMT")) { - /* + /* * The client got an error message because of a temporary problem, * the problem is gone and the client now tries to revalidate our * error message on the real server. The revalidation would always @@ -3197,7 +3261,7 @@ *header, rtime, (rtime == 1 || rtime == -1) ? "e": "es"); if (negative_range) { - rtime *= -1; + rtime *= -1; } rtime *= 60; rtime = pick_from_range(rtime); @@ -3234,7 +3298,7 @@ if (*header == NULL) { log_error(LOG_LEVEL_HEADER, "Insufficient memory, header crunched without replacement."); - return JB_ERR_MEMORY; + return JB_ERR_MEMORY; } hours = rtime / 3600; @@ -3274,7 +3338,7 @@ static jb_err client_if_none_match(struct client_state *csp, char **header) { if (csp->action->flags & ACTION_CRUNCH_IF_NONE_MATCH) - { + { log_error(LOG_LEVEL_HEADER, "Crunching %s", *header); freez(*header); } @@ -3316,7 +3380,7 @@ "force-text-mode overruled the client's request to fetch without filtering!"); } else - { + { csp->content_type = CT_TABOO; /* XXX: This hack shouldn't be necessary */ csp->flags |= CSP_FLAG_NO_FILTERING; log_error(LOG_LEVEL_HEADER, "Accepted the client's request to fetch without filtering."); @@ -3325,7 +3389,7 @@ freez(*header); } } - return JB_ERR_OK; + return JB_ERR_OK; } @@ -3359,7 +3423,7 @@ freez(*header); } - return JB_ERR_OK; + return JB_ERR_OK; } /* the following functions add headers directly to the header list */ @@ -3416,36 +3480,6 @@ } -#if 0 -/********************************************************************* - * - * Function : client_accept_encoding_adder - * - * Description : Add an Accept-Encoding header to the client's request - * that disables compression if the action applies, and - * the header is not already there. Called from `sed'. - * Note: For HTTP/1.0, the absence of the header is enough. - * - * Parameters : - * 1 : csp = Current client state (buffers, headers, etc...) - * - * Returns : JB_ERR_OK on success, or - * JB_ERR_MEMORY on out-of-memory error. - * - *********************************************************************/ -static jb_err client_accept_encoding_adder(struct client_state *csp) -{ - if ( ((csp->action->flags & ACTION_NO_COMPRESSION) != 0) - && (!strcmpic(csp->http->ver, "HTTP/1.1")) ) - { - return enlist_unique(csp->headers, "Accept-Encoding: identity;q=1.0, *;q=0", 16); - } - - return JB_ERR_OK; -} -#endif - - /********************************************************************* * * Function : client_xtra_adder @@ -3530,7 +3564,7 @@ * * Function : server_connection_adder * - * Description : Adds an appropiate "Connection:" header to csp->headers + * Description : Adds an appropriate "Connection:" header to csp->headers * unless the header was already present. Called from `sed'. * * Parameters : @@ -3583,7 +3617,7 @@ * * Description : Adds a "Proxy-Connection: keep-alive" header to * csp->headers if the client asked for keep-alive. - * XXX: We should reuse existant ones. + * XXX: We should reuse existent ones. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) @@ -3728,7 +3762,7 @@ static jb_err server_set_cookie(struct client_state *csp, char **header) { time_t now; - time_t cookie_time; + time_t cookie_time; time(&now); @@ -3895,7 +3929,7 @@ * * Function : strclean * - * Description : In-Situ-Eliminate all occurances of substring in + * Description : In-Situ-Eliminate all occurrences of substring in * string * * Parameters : @@ -3938,7 +3972,7 @@ * to get the numerical respresentation. * * Parameters : - * 1 : header_time = HTTP header time as string. + * 1 : header_time = HTTP header time as string. * 2 : result = storage for header_time in seconds * * Returns : JB_ERR_OK if the time format was recognized, or @@ -3948,34 +3982,49 @@ static jb_err parse_header_time(const char *header_time, time_t *result) { struct tm gmt; - /* - * Zero out gmt to prevent time zone offsets. - * - * While this is only necessary on some platforms - * (mingw32 for example), I don't know how to - * detect these automatically and doing it everywhere - * shouldn't hurt. + * Checking for two-digit years first in an + * attempt to work around GNU libc's strptime() + * reporting negative year values when using %Y. */ - memset(&gmt, 0, sizeof(gmt)); + static const char * const time_formats[] = { + /* Tue, 02-Jun-37 20:00:00 */ + "%a, %d-%b-%y %H:%M:%S", + /* Tue, 02 Jun 2037 20:00:00 */ + "%a, %d %b %Y %H:%M:%S", + /* Tue, 02-Jun-2037 20:00:00 */ + "%a, %d-%b-%Y %H:%M:%S", + /* Tuesday, 02-Jun-2037 20:00:00 */ + "%A, %d-%b-%Y %H:%M:%S", + /* Tuesday Jun 02 20:00:00 2037 */ + "%A %b %d %H:%M:%S %Y" + }; + unsigned int i; - /* Tue, 02 Jun 2037 20:00:00 */ - if ((NULL == strptime(header_time, "%a, %d %b %Y %H:%M:%S", &gmt)) - /* Tue, 02-Jun-2037 20:00:00 */ - && (NULL == strptime(header_time, "%a, %d-%b-%Y %H:%M:%S", &gmt)) - /* Tue, 02-Jun-37 20:00:00 */ - && (NULL == strptime(header_time, "%a, %d-%b-%y %H:%M:%S", &gmt)) - /* Tuesday, 02-Jun-2037 20:00:00 */ - && (NULL == strptime(header_time, "%A, %d-%b-%Y %H:%M:%S", &gmt)) - /* Tuesday Jun 02 20:00:00 2037 */ - && (NULL == strptime(header_time, "%A %b %d %H:%M:%S %Y", &gmt))) + for (i = 0; i < SZ(time_formats); i++) { - return JB_ERR_PARSE; - } + /* + * Zero out gmt to prevent time zone offsets. + * Documented to be required for GNU libc. + */ + memset(&gmt, 0, sizeof(gmt)); - *result = timegm(&gmt); + if (NULL != strptime(header_time, time_formats[i], &gmt)) + { + /* Sanity check for GNU libc. */ + if (gmt.tm_year < 0) + { + log_error(LOG_LEVEL_HEADER, + "Failed to parse '%s' using '%s'. Moving on.", + header_time, time_formats[i]); + continue; + } + *result = timegm(&gmt); + return JB_ERR_OK; + } + } - return JB_ERR_OK; + return JB_ERR_PARSE; } @@ -3994,7 +4043,7 @@ * Parameters : * 1 : headers = List of headers (one of them hopefully being * the "Host:" header) - * 2 : http = storage for the result (host, port and hostport). + * 2 : http = storage for the result (host, port and hostport). * * Returns : JB_ERR_MEMORY in case of memory problems, * JB_ERR_PARSE if the host header couldn't be found, @@ -4015,7 +4064,8 @@ return JB_ERR_PARSE; } - if (NULL == (p = strdup((host)))) + p = strdup(host); + if (NULL == p) { log_error(LOG_LEVEL_ERROR, "Out of memory while parsing \"Host:\" header"); return JB_ERR_MEMORY; @@ -4068,7 +4118,7 @@ * * Description : Helper for client_referrer to forge a referer as * 'http://[hostname:port/' to fool stupid - * checks for in-site links + * checks for in-site links * * Parameters : * 1 : header = Pointer to header pointer @@ -4159,7 +4209,7 @@ const char *host, const int parameter_conditional_block) { char *referer = strdup(*header); - const size_t hostlenght = strlen(host); + const size_t hostlength = strlen(host); const char *referer_url = NULL; if (NULL == referer) @@ -4169,14 +4219,14 @@ } /* referer begins with 'Referer: http[s]://' */ - if ((hostlenght+17) < strlen(referer)) + if ((hostlength+17) < strlen(referer)) { /* * Shorten referer to make sure the referer is blocked * if www.example.org/www.example.com-shall-see-the-referer/ * links to www.example.com/ */ - referer[hostlenght+17] = '\0'; + referer[hostlength+17] = '\0'; } referer_url = strstr(referer, "http://"); if ((NULL == referer_url) || (NULL == strstr(referer_url, host))) diff -Nru privoxy-3.0.17/parsers.h privoxy-3.0.19/parsers.h --- privoxy-3.0.17/parsers.h 2009-06-21 19:21:14.000000000 +0000 +++ privoxy-3.0.19/parsers.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef PARSERS_H_INCLUDED #define PARSERS_H_INCLUDED -#define PARSERS_H_VERSION "$Id: parsers.h,v 1.50 2009/05/16 13:27:20 fabiankeil Exp $" +#define PARSERS_H_VERSION "$Id: parsers.h,v 1.51 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.h,v $ @@ -20,10 +20,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/pcrs.c privoxy-3.0.19/pcrs.c --- privoxy-3.0.17/pcrs.c 2009-08-19 15:28:08.000000000 +0000 +++ privoxy-3.0.19/pcrs.c 2011-09-04 11:10:56.000000000 +0000 @@ -1,4 +1,4 @@ -const char pcrs_rcs[] = "$Id: pcrs.c,v 1.35 2009/08/19 15:28:08 fabiankeil Exp $"; +const char pcrs_rcs[] = "$Id: pcrs.c,v 1.38 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/pcrs.c,v $ @@ -16,7 +16,7 @@ * * Copyright (C) 2006, 2007 Fabian Keil * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser * General Public License (LGPL), version 2.1, which should * be included in this distribution (see LICENSE.txt), with @@ -71,7 +71,7 @@ * Function : pcrs_strerror * * Description : Return a string describing a given error code. - * + * * Parameters : * 1 : error = the error code * @@ -80,7 +80,7 @@ *********************************************************************/ const char *pcrs_strerror(const int error) { - if (error < 0) + if (error != 0) { switch (error) { @@ -94,7 +94,7 @@ case PCRE_ERROR_UNKNOWN_NODE: return "(pcre:) Bad node in pattern"; /* Can't happen / not passed: */ - case PCRE_ERROR_NOSUBSTRING: return "(pcre:) Fire in power supply"; + case PCRE_ERROR_NOSUBSTRING: return "(pcre:) Fire in power supply"; case PCRE_ERROR_NOMATCH: return "(pcre:) Water in power supply"; #ifdef PCRE_ERROR_MATCHLIMIT @@ -113,7 +113,7 @@ case PCRS_WARN_TRUNCATION: return "(pcrs:) At least one variable was too big and has been truncated before compilation"; - /* + /* * XXX: With the exception of PCRE_ERROR_MATCHLIMIT we * only catch PCRE errors that can happen with our internal * version. If Privoxy is linked against a newer @@ -139,12 +139,12 @@ * 'T' (trivial) options but pcrs needs them, the corresponding * flags are set if 'g'or 'T' is encountered. * Note: The 'T' and 'U' options do not conform to Perl. - * + * * Parameters : * 1 : optstring = string with options in perl syntax * 2 : flags = see description * - * Returns : option integer suitable for pcre + * Returns : option integer suitable for pcre * *********************************************************************/ static int pcrs_parse_perl_options(const char *optstring, int *flags) @@ -236,7 +236,7 @@ return NULL; } memset(text, '\0', length + 1); - + /* * In trivial mode, just copy the substitute text @@ -305,7 +305,7 @@ assert(ascii_value < 256); text[k++] = (char)ascii_value; i += 4; - } + } else { quoted = 1; @@ -337,7 +337,7 @@ /* Symbolic backreferences: */ else if (NULL != (symbol = strchr(symbols, replacement[i + 1]))) { - + if (symbol - symbols == 2) /* $+ */ { r->backref[l] = capturecount; @@ -368,10 +368,10 @@ else { *errptr = PCRS_WARN_BADREF; - } + } continue; } - + plainchar: /* Plain chars are copied */ text[k++] = replacement[i++]; @@ -397,13 +397,13 @@ * Function : pcrs_free_job * * Description : Frees the memory used by a pcrs_job struct and its - * dependant structures. + * dependent structures. * * Parameters : * 1 : job = pointer to the pcrs_job structure to be freed * * Returns : a pointer to the next job, if there was any, or - * NULL otherwise. + * NULL otherwise. * *********************************************************************/ pcrs_job *pcrs_free_job(pcrs_job *job) @@ -458,7 +458,7 @@ * * Function : pcrs_compile_command * - * Description : Parses a string with a Perl-style s/// command, + * Description : Parses a string with a Perl-style s/// command, * calls pcrs_compile, and returns a corresponding * pcrs_job, or NULL if parsing or compiling the job * fails. @@ -478,11 +478,11 @@ int i, k, l, quoted = FALSE; size_t limit; char delimiter; - char *tokens[4]; + char *tokens[4]; pcrs_job *newjob; - + k = l = 0; - + /* * Tokenize the perl command */ @@ -501,7 +501,7 @@ for (i = 0; i <= (int)limit; i++) { - + if (command[i] == delimiter && !quoted) { if (l == 3) @@ -513,7 +513,7 @@ tokens[++l] = tokens[0] + k; continue; } - + else if (command[i] == '\\' && !quoted) { quoted = TRUE; @@ -535,11 +535,11 @@ free(tokens[0]); return NULL; } - + newjob = pcrs_compile(tokens[1], tokens[2], tokens[3], errptr); free(tokens[0]); return newjob; - + } @@ -571,14 +571,14 @@ *errptr = 0; - /* + /* * Handle NULL arguments */ if (pattern == NULL) pattern = ""; if (substitute == NULL) substitute = ""; - /* + /* * Get and init memory */ if (NULL == (newjob = (pcrs_job *)malloc(sizeof(pcrs_job)))) @@ -618,10 +618,10 @@ pcrs_free_job(newjob); return NULL; } - - /* - * Determine the number of capturing subpatterns. + + /* + * Determine the number of capturing subpatterns. * This is needed for handling $+ in the substitute. */ if (0 > (*errptr = pcre_fullinfo(newjob->pattern, newjob->hints, PCRE_INFO_CAPTURECOUNT, &capturecount))) @@ -629,7 +629,7 @@ pcrs_free_job(newjob); return NULL; } - + /* * Compile the substitute @@ -639,7 +639,7 @@ pcrs_free_job(newjob); return NULL; } - + return newjob; } @@ -654,7 +654,7 @@ * the joblist to the subject. * The subject itself is left untouched, memory for the result * is malloc()ed and it is the caller's responsibility to free - * the result when it's no longer needed. + * the result when it's no longer needed. * * Note: For convenient string handling, a null byte is * appended to the result. It does not count towards the @@ -664,8 +664,8 @@ * Parameters : * 1 : joblist = the chained list of pcrs_jobs to be executed * 2 : subject = the subject string - * 3 : subject_length = the subject's length - * 4 : result = char** for returning the result + * 3 : subject_length = the subject's length + * 4 : result = char** for returning the result * 5 : result_length = size_t* for returning the result's length * * Returns : On success, the number of substitutions that were made. @@ -679,7 +679,7 @@ pcrs_job *job; char *old, *new = NULL; int hits, total_hits; - + old = subject; *result_length = subject_length; total_hits = 0; @@ -724,8 +724,8 @@ * Parameters : * 1 : job = the pcrs_job to be executed * 2 : subject = the subject (== original) string - * 3 : subject_length = the subject's length - * 4 : result = char** for returning the result + * 3 : subject_length = the subject's length + * 4 : result = char** for returning the result * 5 : result_length = size_t* for returning the result's length * * Returns : On success, the number of substitutions that were made. @@ -748,7 +748,7 @@ offset = i = 0; - /* + /* * Sanity check & memory allocation */ if (job == NULL || job->pattern == NULL || job->substitute == NULL || NULL == subject) @@ -781,13 +781,13 @@ matches[i].submatch_offset[k] = offsets[2 * k]; /* Note: Non-found optional submatches have length -1-(-1)==0 */ - matches[i].submatch_length[k] = (size_t)(offsets[2 * k + 1] - offsets[2 * k]); + matches[i].submatch_length[k] = (size_t)(offsets[2 * k + 1] - offsets[2 * k]); /* reserve mem for each submatch as often as it is ref'd */ newsize += matches[i].submatch_length[k] * (size_t)job->substitute->backref_count[k]; } /* plus replacement text size minus match text size */ - newsize += job->substitute->length - matches[i].submatch_length[0]; + newsize += job->substitute->length - matches[i].submatch_length[0]; /* chunk before match */ matches[i].submatch_offset[PCRS_MAX_SUBMATCHES] = 0; @@ -829,12 +829,12 @@ if (submatches < PCRE_ERROR_NOMATCH) { free(matches); - return submatches; + return submatches; } matches_found = i; - /* + /* * Get memory for the result (must be freed by caller!) * and append terminating null byte. */ @@ -849,7 +849,7 @@ } - /* + /* * Replace */ offset = 0; @@ -858,7 +858,7 @@ for (i = 0; i < matches_found; i++) { /* copy the chunk preceding the match */ - memcpy(result_offset, subject + offset, (size_t)(matches[i].submatch_offset[0] - offset)); + memcpy(result_offset, subject + offset, (size_t)(matches[i].submatch_offset[0] - offset)); result_offset += matches[i].submatch_offset[0] - offset; /* For every segment of the substitute.. */ @@ -988,7 +988,7 @@ * Parameters : * 1 : string = The string to search in * - * Returns : A safe delimiter if one was found, otherwise '\0'. + * Returns : A safe delimiter if one was found, otherwise '\0'. * *********************************************************************/ char pcrs_get_delimiter(const char *string) @@ -1021,11 +1021,11 @@ * * Parameters : * 1 : subject = the subject (== original) string - * 2 : pcrs_command = the pcrs command as string (s@foo@bar@) - * 3 : hits = int* for returning the number of modifications + * 2 : pcrs_command = the pcrs command as string (s@foo@bar@) + * 3 : hits = int* for returning the number of modifications * * Returns : NULL in case of errors, otherwise the - * result of the pcrs command. + * result of the pcrs command. * *********************************************************************/ char *pcrs_execute_single_command(const char *subject, const char *pcrs_command, int *hits) @@ -1069,7 +1069,7 @@ * 3 : error = pcrs error code * * Returns : NULL in case of hard errors, otherwise the - * compiled pcrs job. + * compiled pcrs job. * *********************************************************************/ pcrs_job *pcrs_compile_dynamic_command(char *pcrs_command, const struct pcrs_variable v[], int *error) diff -Nru privoxy-3.0.17/privoxy.1 privoxy-3.0.19/privoxy.1 --- privoxy-3.0.17/privoxy.1 2010-11-13 14:45:47.000000000 +0000 +++ privoxy-3.0.19/privoxy.1 2011-12-26 18:42:00.000000000 +0000 @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "PRIVOXY" "1" "13 November 2010" "Privoxy 3.0.17" "" +.TH "PRIVOXY" "1" "26 Dezember 2011" "Privoxy 3.0.19" "" .SH NAME privoxy \- Privacy Enhancing Proxy .SH SYNOPSIS @@ -45,7 +45,7 @@ \fBPrivoxy\fR process that the directory tree starts there. If set up carefully, this can limit the impact of possible vulnerabilities in \fBPrivoxy\fR to the files contained in -that hierarchy. +that hierarchy. .TP \fB\-\-pre-chroot-nslookup \fIhostname\fB\fR Initialize the resolver library using \fIhostname\fR @@ -55,7 +55,7 @@ If the \fIconfigfile\fR is not specified on the command line, \fBPrivoxy\fR will look for a file named \fIconfig\fR in the current directory. If no -\fIconfigfile\fR is found, \fBPrivoxy\fR will +\fIconfigfile\fR is found, \fBPrivoxy\fR will fail to start. .SH "DESCRIPTION" .PP @@ -84,19 +84,19 @@ filter to build an intercepting proxy (see \fIconfig\fR). The default setting is for localhost, on port 8118 (configurable in the main config file). To set the -HTTP proxy in Firefox, go through: \fBTools\fR; +HTTP proxy in Firefox, go through: \fBTools\fR; \fBOptions\fR; \fBGeneral\fR; \fBConnection Settings\fR; -\fBManual Proxy Configuration\fR. +\fBManual Proxy Configuration\fR. .PP -For Internet Explorer, go through: \fBTools\fR; +For Internet Explorer, go through: \fBTools\fR; \fBInternet Properties\fR; \fBConnections\fR; -\fBLAN Settings\fR. +\fBLAN Settings\fR. .PP The Secure (SSL) Proxy should also be set to the same values, otherwise https: URLs will not be proxied. Note: \fBPrivoxy\fR can only proxy HTTP and HTTPS traffic. Do not try it with FTP or other protocols. -HTTPS presents some limitations, and not all features will work with HTTPS +HTTPS presents some limitations, and not all features will work with HTTPS connections. .PP For other browsers, check the documentation. @@ -105,23 +105,23 @@ \fBPrivoxy\fR can be configured with the various configuration files. The default configuration files are: \fIconfig\fR, \fIdefault.filter\fR, \fIdefault.action\fR and -\fIdefault.action\fR. \fIuser.action\fR should +\fIdefault.action\fR. \fIuser.action\fR should be used for locally defined exceptions to the default rules in \fImatch-all.action\fR and \fIdefault.action\fR, and \fIuser.filter\fR for locally defined filters. These are well commented. On Unix and Unix-like systems, these are located in -\fI/etc/privoxy/\fR by default. +\fI/etc/privoxy/\fR by default. .PP -\fBPrivoxy\fR uses the concept of \fBactions\fR +\fBPrivoxy\fR uses the concept of \fBactions\fR in order to manipulate the data stream between the browser and remote sites. -There are various actions available with specific functions for such things +There are various actions available with specific functions for such things as blocking web sites, managing cookies, etc. These actions can be invoked -individually or combined, and used against individual URLs, or groups of URLs +individually or combined, and used against individual URLs, or groups of URLs that can be defined using wildcards and regular expressions. The result is that the user has greatly enhanced control and freedom. .PP The actions list (ad blocks, etc) can also be configured with your -web browser at http://config.privoxy.org/ +web browser at http://config.privoxy.org/ (assuming the configuration allows it). \fBPrivoxy's\fR configuration parameters can also be viewed at the same page. In addition, \fBPrivoxy\fR can be toggled on/off. @@ -133,7 +133,6 @@ .SH "FILES" .nf - \fI/usr/sbin/privoxy\fR \fI/etc/privoxy/config\fR \fI/etc/privoxy/match-all.action\fR @@ -153,11 +152,11 @@ .PP \fBPrivoxy\fR terminates on the \fBSIGINT\fR, \fBSIGTERM\fR and \fBSIGABRT\fR signals. Log -rotation scripts may cause a re-opening of the logfile by sending a +rotation scripts may cause a re-opening of the logfile by sending a \fBSIGHUP\fR to \fBPrivoxy\fR. Note that unlike other daemons, \fBPrivoxy\fR does not need to be made aware of config file changes by \fBSIGHUP\fR -- it will detect them -automatically. +automatically. .SH "NOTES" .PP Please see the \fIUser Manual\fR on how to contact the @@ -168,17 +167,17 @@ users: .PP -http://www.privoxy.org/, -the \fBPrivoxy\fR Home page. +http://www.privoxy.org/, +the \fBPrivoxy\fR Home page. -http://www.privoxy.org/faq/, -the \fBPrivoxy\fR FAQ. +http://www.privoxy.org/faq/, +the \fBPrivoxy\fR FAQ. -http://www.privoxy.org/developer-manual/, -the \fBPrivoxy\fR developer manual. +http://www.privoxy.org/developer-manual/, +the \fBPrivoxy\fR developer manual. -https://sourceforge.net/projects/ijbswa/, -the Project Page for \fBPrivoxy\fR on +https://sourceforge.net/projects/ijbswa/, +the Project Page for \fBPrivoxy\fR on SourceForge. http://config.privoxy.org/, @@ -186,7 +185,7 @@ running for this to work. Shortcut: http://p.p/ https://sourceforge.net/tracker/?group_id=11118&atid=460288, to submit ``misses'' and other -configuration related suggestions to the developers. +configuration related suggestions to the developers. .SH "DEVELOPMENT TEAM" .nf @@ -194,15 +193,13 @@ David Schmidt, developer Hal Burgiss - Mark Miller - Gerry Murphy Lee Rian Roland Rosenfeld .fi .SH "COPYRIGHT AND LICENSE" .SS "COPYRIGHT" .PP -Copyright (C) 2001-2010 by Privoxy Developers +Copyright (C) 2001-2011 by Privoxy Developers .PP Some source code is based on code Copyright (C) 1997 by Anonymous Coders and Junkbusters, Inc. and licensed under the \fIGNU General Public @@ -210,7 +207,7 @@ .SS "LICENSE" .PP \fBPrivoxy\fR is free software; you can -redistribute it and/or modify it under the terms of the +redistribute it and/or modify it under the terms of the \fIGNU General Public License\fR, version 2, as published by the Free Software Foundation. .PP diff -Nru privoxy-3.0.17/project.h privoxy-3.0.19/project.h --- privoxy-3.0.17/project.h 2010-10-10 09:58:12.000000000 +0000 +++ privoxy-3.0.19/project.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,7 +1,7 @@ #ifndef PROJECT_H_INCLUDED #define PROJECT_H_INCLUDED /** Version string. */ -#define PROJECT_H_VERSION "$Id: project.h,v 1.160 2010/10/10 09:58:12 fabiankeil Exp $" +#define PROJECT_H_VERSION "$Id: project.h,v 1.171 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/project.h,v $ @@ -148,7 +148,7 @@ #define JB_ERR_CGI_PARAMS 2 /**< Missing or corrupt CGI parameters */ #define JB_ERR_FILE 3 /**< Error opening, reading or writing a file */ #define JB_ERR_PARSE 4 /**< Error parsing file */ -#define JB_ERR_MODIFIED 5 /**< File has been modified outside of the +#define JB_ERR_MODIFIED 5 /**< File has been modified outside of the CGI actions editor. */ #define JB_ERR_COMPRESS 6 /**< Error on decompression */ @@ -173,7 +173,7 @@ */ #define ijb_toupper(__X) toupper((int)(unsigned char)(__X)) #define ijb_tolower(__X) tolower((int)(unsigned char)(__X)) -#define ijb_isspace(__X) isspace((int)(unsigned char)(__X)) +#define ijb_isspace(__X) isspace((int)(unsigned char)(__X)) /** * Use for statically allocated buffers if you have no other choice. @@ -191,7 +191,7 @@ * Buffer size for capturing struct hostent data in the * gethostby(name|addr)_r library calls. Since we don't * loop over gethostbyname_r, the buffer must be sufficient - * to accomodate multiple IN A RRs, as used in DNS round robin + * to accommodate multiple IN A RRs, as used in DNS round robin * load balancing. W3C's wwwlib uses 1K, so that should be * good enough for us, too. */ @@ -233,7 +233,7 @@ * your own code. */ char *str; - + /** Next entry in the linked list, or NULL if no more. */ struct list_entry *next; }; @@ -503,7 +503,7 @@ #define ACTION_FORCE_TEXT_MODE 0x00400000UL /** Action bitmap: Enable text mode by force */ #define ACTION_CRUNCH_IF_NONE_MATCH 0x00800000UL -/** Action bitmap: Enable content-dispostion crunching */ +/** Action bitmap: Enable content-disposition crunching */ #define ACTION_HIDE_CONTENT_DISPOSITION 0x01000000UL /** Action bitmap: Replace or block Last-Modified header */ #define ACTION_OVERWRITE_LAST_MODIFIED 0x02000000UL @@ -531,7 +531,7 @@ #define ACTION_STRING_LANGUAGE 8 /** Action string index: Replacement for the "Content-Type:" header*/ #define ACTION_STRING_CONTENT_TYPE 9 -/** Action string index: Replacement for the "content-dispostion:" header*/ +/** Action string index: Replacement for the "content-disposition:" header*/ #define ACTION_STRING_CONTENT_DISPOSITION 10 /** Action string index: Replacement for the "If-Modified-Since:" header*/ #define ACTION_STRING_IF_MODIFIED_SINCE 11 @@ -675,7 +675,7 @@ /* * Flags for use in csp->flags */ - + /** * Flag for csp->flags: Set if this client is processing data. * Cleared when the thread associated with this structure dies. @@ -765,7 +765,7 @@ #define CSP_FLAG_SERVER_CONTENT_LENGTH_SET 0x00002000U /** - * Flag for csp->flags: Set if we know the content lenght, + * Flag for csp->flags: Set if we know the content length, * either because the server set it, or we figured it out * on our own. */ @@ -810,6 +810,17 @@ */ #define CSP_FLAG_REUSED_CLIENT_CONNECTION 0x00100000U +/** + * Flag for csp->flags: Set if the supports deflate compression. + */ +#define CSP_FLAG_CLIENT_SUPPORTS_DEFLATE 0x00200000U + +/** + * Flag for csp->flags: Set if the content has been deflated by Privoxy + */ +#define CSP_FLAG_BUFFERED_CONTENT_DEFLATED 0x00400000U + + /* * Flags for use in return codes of child processes */ @@ -833,6 +844,12 @@ #define MAX_AF_FILES 10 /** + * Maximum number of sockets to listen to. This limit is arbitrary - it's just used + * to size an array. + */ +#define MAX_LISTENING_SOCKETS 10 + +/** * The state of a Privoxy processing thread. */ struct client_state @@ -995,7 +1012,7 @@ * Read-only once the structure has been created. */ time_t lastmodified; - + /** * The full filename. */ @@ -1031,12 +1048,16 @@ #endif /* def FEATURE_TRUST */ - -#define SOCKS_NONE 0 /**< Don't use a SOCKS server */ -#define SOCKS_4 40 /**< original SOCKS 4 protocol */ -#define SOCKS_4A 41 /**< as modified for hosts w/o external DNS */ -#define SOCKS_5 50 /**< as modified for hosts w/o external DNS */ - +enum forwarder_type { + /**< Don't use a SOCKS server */ + SOCKS_NONE = 0, + /**< original SOCKS 4 protocol */ + SOCKS_4 = 40, + /**< SOCKS 4A, DNS resolution is done by the SOCKS server */ + SOCKS_4A = 41, + /**< SOCKS 5 with hostnames, DNS resolution is done by the SOCKS server */ + SOCKS_5 = 50, +}; /** * How to forward a connection to a parent proxy. @@ -1047,7 +1068,7 @@ struct url_spec url[1]; /** Connection type. Must be SOCKS_NONE, SOCKS_4, SOCKS_4A or SOCKS_5. */ - int type; + enum forwarder_type type; /** SOCKS server hostname. Only valid if "type" is SOCKS_4 or SOCKS_4A. */ char *gateway_host; @@ -1175,6 +1196,9 @@ /** configuration_spec::feature_flags: Pages blocked with +handle-as-empty-doc get a return status of 200 OK. */ #define RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK 512U +/** configuration_spec::feature_flags: Buffered content is sent compressed if the client supports it. */ +#define RUNTIME_FEATURE_COMPRESSION 1024U + /** * Data loaded from the configuration file. * @@ -1184,7 +1208,7 @@ { /** What to log */ int debug; - + /** Nonzero to enable multithreading. */ int multi_threaded; @@ -1241,11 +1265,11 @@ /** The hostname to show on CGI pages, or NULL to use the real one. */ const char *hostname; - /** IP address to bind to. Defaults to HADDR_DEFAULT == 127.0.0.1. */ - const char *haddr; + /** IP addresses to bind to. Defaults to HADDR_DEFAULT == 127.0.0.1. */ + const char *haddr[MAX_LISTENING_SOCKETS]; - /** Port to bind to. Defaults to HADDR_PORT == 8118. */ - int hport; + /** Ports to bind to. Defaults to HADDR_PORT == 8118. */ + int hport[MAX_LISTENING_SOCKETS]; /** Size limit for IOB */ size_t buffer_limit; @@ -1290,6 +1314,10 @@ unsigned int default_server_timeout; #endif +#ifdef FEATURE_COMPRESSION + int compression_level; +#endif + /** All options from the config file, HTML-formatted. */ char *proxy_args; @@ -1319,7 +1347,7 @@ #endif /* def FEATURE_NO_GIFS */ -/* +/* * Hardwired URLs */ diff -Nru privoxy-3.0.17/README privoxy-3.0.19/README --- privoxy-3.0.17/README 2010-11-13 13:22:09.000000000 +0000 +++ privoxy-3.0.19/README 2011-12-26 17:04:33.000000000 +0000 @@ -4,14 +4,14 @@ * * Purpose : README file to give a short intro. * - * Copyright : Written by and Copyright (C) 2001-2010 the + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -26,13 +26,13 @@ * The GNU General Public License should be included with * this file. If not, you can view it at * http://www.gnu.org/copyleft/gpl.html - * or write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * or write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA * *********************************************************************/ -This README is included with Privoxy 3.0.17. See http://www.privoxy.org/ for +This README is included with Privoxy 3.0.19. See http://www.privoxy.org/ for more information. The current code maturity level is "stable". ------------------------------------------------------------------------------- @@ -56,19 +56,10 @@ ------------------------------------------------------------------------------- -1. IMPORTANT CHANGES +1. CHANGES -November 2010, Privoxy 3.0.17 stable is released. - -This is mainly a bug-fix release for the previously released Privoxy 3.0.16. - -It contains fixes for two bugs that could cause connections to hang under -certain circumstances when keep-alive support was enabled, until they timed -out or where closed by the server. - -As usual, there are also a bunch of minor improvements. For details please -see the "ChangeLog", the "What's New" section or the "Upgrader's Notes" in -the User Manual. +For a list of changes in this release, please have a look at the "ChangeLog", +the "What's New" section or the "Upgrader's Notes" in the User Manual. ------------------------------------------------------------------------------- @@ -149,6 +140,13 @@ Please don't sent private support requests to individual Privoxy developers, either use the mailing lists or the support trackers. +If you have to contact a Privoxy developer directly for other reasons, please +send a real mail and do not bother with SourceForge's messaging system. Answers +to SourceForge messages are usually bounced by SourceForge's mail server in +which case the developer wasted time writing a response you don't get. From +your point of view it will look like your message has been completely ignored, +so this is frustrating for all parties involved. + Note that the Privoxy mailing lists are moderated. Posts from unsubscribed addresses have to be accepted manually by a moderator. This may cause a delay of several days and if you use a subject that doesn't clearly mention Privoxy @@ -278,6 +276,9 @@ bother to add an email address when using the tracker. If you prefer to communicate through email, just use one of the mailing lists directly. +If you are new to reporting problems, you might be interested in How to Report +Bugs Effectively. + The appendix of the Privoxy User Manual also has helpful information on understanding actions, and action debugging. diff -Nru privoxy-3.0.17/regression-tests.action privoxy-3.0.19/regression-tests.action --- privoxy-3.0.17/regression-tests.action 2009-10-10 14:28:40.000000000 +0000 +++ privoxy-3.0.19/regression-tests.action 2011-11-06 11:46:58.000000000 +0000 @@ -1,5 +1,5 @@ ############################################################################# -# $Id: regression-tests.action,v 1.33 2009/10/10 14:28:40 fabiankeil Exp $ +# $Id: regression-tests.action,v 1.42 2011/11/06 11:46:58 fabiankeil Exp $ ############################################################################# # # This is a configuration file for Privoxy-Regression-Test @@ -10,7 +10,7 @@ # ############################################################################# # -# Copyright (c) 2007-2009 Fabian Keil +# Copyright (c) 2007-2011 Fabian Keil # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -26,8 +26,10 @@ # ############################################################################# +# While the syntax used is understood by Privoxy 3.0.14 and later, +# some of the +fast-redirects{} tests require at least 3.0.18 to work. {{settings}} -for-privoxy-version=3.0.14 +for-privoxy-version=3.0.18 # Some dependencies Privoxy-Regression-Test should know about: # @@ -40,6 +42,10 @@ # Level 16 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE Yes # Level 16 needs = config line connection-sharing\s+1 # Level 17 needs = feature status FEATURE_PTHREAD Yes +# Level 18 needs = feature status FEATURE_GRACEFUL_TERMINATION No +# Level 19 needs = feature status FEATURE_GRACEFUL_TERMINATION Yes +# Level 20 needs = feature status FEATURE_TOGGLE Yes +# Level 21 needs = feature status FEATURE_TOGGLE No ####################################################### # Enable taggers to activate the tests on demand @@ -79,11 +85,11 @@ # 2) conditional-forge # 3) forge # 4) block -# 5) a parameter that looks like a valid fake referrer +# 5) a parameter that looks like a valid fake referrer # 6) a parameter that looks like an invalid fake referrer ####################################################### -# Set Header = Referer: http://www.example.org/foo +# Set Header = Referer: http://www.example.org/foo # Expect Header = REMOVAL # # Set Header = Referer: http://p.p/foo @@ -103,7 +109,7 @@ {+hide-referrer{conditional-block}} TAG:^hide-referrer\{conditional-block\}$ -# Set Header = Referer: http://www.example.org/foo +# Set Header = Referer: http://www.example.org/foo # Expect Header = Referer: http://p.p/ # # Set Header = Referer: http://p.p/foo @@ -123,17 +129,17 @@ {+hide-referrer{conditional-forge}} TAG:^hide-referrer\{conditional-forge\}$ -# Set Header = Referer: http://www.example.org/foo +# Set Header = Referer: http://www.example.org/foo # Expect Header = Referer: http://p.p/ {+hide-referrer{forge}} TAG:^hide-referrer\{forge\}$ -# Set Header = Referer: http://www.example.org/foo +# Set Header = Referer: http://www.example.org/foo # Expect Header = REMOVAL {+hide-referrer{block}} TAG:^hide-referrer\{block\}$ -# Set Header = Referer: http://www.example.org/foo +# Set Header = Referer: http://www.example.org/foo # Expect Header = Referer: invalid {+hide-referrer{invalid}} TAG:^hide-referrer\{invalid\}$ @@ -429,6 +435,7 @@ # Set Header = Request-Range: bytes=1234-5678 # Expect Header = REMOVAL {\ + -client-header-tagger{range-requests} \ +deanimate-gifs{last} \ -filter \ } @@ -441,6 +448,7 @@ # Set Header = Request-Range: bytes=1234-5678 # Expect Header = REMOVAL {\ + -client-header-tagger{range-requests} \ -deanimate-gifs \ +filter{banners-by-size} \ } @@ -453,6 +461,7 @@ # Set Header = Request-Range: bytes=1234-5678 # Expect Header = NO CHANGE {\ + -client-header-tagger{range-requests} \ -deanimate-gifs \ -filter \ } @@ -556,9 +565,12 @@ ################################################################ # Fetch Test = http://p.p/ -# Will fail if compiled with FEATURE_GRACEFUL_TERMINATION # Fetch Test = http://p.p/die # Expect Status Code = 404 +# Level = 18 +# Fetch Test = http://p.p/die +# Expect Status Code = 200 +# Level = 19 # Fetch Test = http://p.p/show-status # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=0 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=0 @@ -583,7 +595,12 @@ # Fetch Test = http://p.p/show-url-info?url=FTp:%2F%2Fwww.privoxy.org%2F # Fetch Test = http://p.p/show-url-info?url= # Fetch Test = http://p.p/show-url-info?url=%2F +# Depends on FEATURE_TOGGLE +# Fetch Test = http://p.p/toggle +# Level = 20 # Fetch Test = http://p.p/toggle +# Expect Status Code = 404 +# Level = 21 # Fetch Test = http://p.p/edit-actions # Fetch Test = http://p.p/eaa # Fetch Test = http://p.p/eau @@ -743,10 +760,20 @@ {+forward-override{forward-socks5 127.0.0.1:12345 .}} oh-dear-this-hostname-is-so-very-long-that-it-can-not-possibly-be-forwarded-through-socks5-as-a-result-we-therefore-expect-privoxy-to-return-an-error-response-instead-of-forwarding-the-request-because-as-already-mentioned-this-host-is-really-very-long.example/ -# Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks-server-listening.example +# Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example # Expect Status Code = 503 {+forward-override{forward-socks5 127.0.0.1:12345 .}} -oh-dear-this-hostname-is-short-enough-but-there-is-no-socks-server-listening.example +oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example + +# Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example +# Expect Status Code = 503 +{+forward-override{forward-socks4 127.0.0.1:12345 .}} +oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example + +# Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example +# Expect Status Code = 503 +{+forward-override{forward-socks4a 127.0.0.1:12345 .}} +oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example # This one currently triggers the same error condition as the # test above (socks5 server unreachable), but once Privoxy @@ -818,3 +845,47 @@ # Expect Header = X-LWS-Test: "This is quoted" this is not "this is " but " this again is not {} TAG:^LWS Tests$ + +{+fast-redirects{check-decoded-url}} +# Redirected URL = http://redirect.example.net/blafasel&url=http://redirected1.example.net/ +# Redirect Destination = http://redirected1.example.net/ +# Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected2.example.net%2F¶meter=not-part-of-the-redirected-url +# Redirect Destination = http://redirected2.example.net/ +# Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected3.example.net%2F¶meter=not-part-of-the-redirected-url +# Redirect Destination = http://redirected3.example.net/ +# Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected4.example.net%2F%26parameter=part-of-the-redirected-url +# Redirect Destination = http://redirected4.example.net/¶meter=part-of-the-redirected-url +# Redirected URL = http://redirect.example.net/blafasel&url1=http%3A%2F%2Fredirected5.example.net%2F%26parameter1=part-of-the-redirected-url&url2=http%3A%2F%2Fredirected5.example.net%2F%26parameter2=part-of-the-redirected-url2 +# Redirect Destination = http://redirected5.example.net/¶meter2=part-of-the-redirected-url2 +# Redirected URL = http://redirect.example.net/blafasel&url1=http%3A%2F%2Fredirected6.example.net%2F%26parameter1=part-of-the-redirected-url&url2=http%3A%2F%2Fredirected6.example.net%2F%26parameter2=part-of-the-redirected-url2¶meter3=not-part-of-the-redirected-url2 +# Redirect Destination = http://redirected6.example.net/¶meter2=part-of-the-redirected-url2 +# Redirected URL = http://redirect.example.net/blafasel?x=http%3A%2F%2Fredirected7.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1 +# Redirect Destination = http://redirected7.example.net/¶meter1=part-of-the-redirected-url1 +# Redirected URL = http://redirect.example.net/blafasel?x=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1 +# Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1 +# Redirected URL = http://redirect.example.net/blafasel?a?b?c?d?e?f?g?h?i?j?k?l?m?n?o?p?q?r?s&t&u&v&w&x&y&z&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16x=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1 +# Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1 +# Redirected URL = http://redirect.example.net/blafasel???????????????????????????????=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1 +# Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1 +# Redirected URL = http://redirect.example.net/blafasel&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1¶meter2=not-part-of-the-redirected-url1¶meter3=not-part-of-the-redirected-url1 +# Redirect Destination = http://redirected8.example.net/¶meter1=part-of-the-redirected-url1 +redirect.example.net/ +# Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http://redirect2.example.net/ +# Redirect Destination = http://redirect2.example.net/ +# Redirected URL = http://redirect.example.net/blafasel%3A%2F%2Fredirect1.example.net/http://redirect2.example.net/ +# Redirect Destination = http://redirect2.example.net/ +# Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/ +# Redirect Destination = http://redirect2.example.net/ +# These tests verify that Privoxy behaves as intended, +# given that the encoded redirect URLs are invalid, +# there are no correct redirect URLs. +# Redirected URL = http://redirect.example.net/%%%%%%%%%%%%%%%%%%%%%%blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/%%%%%%%%%%%%%% +# Redirect Destination = http://redirect2.example.net/%%%%%%%%%%%%%% +# Redirected URL = http://redirect.example.net/%%%%%%%%%%%%%%%%%%%%%%blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/%1%2%%3%4%5%6%7%8%9%0%0%% +# Redirect Destination = http://redirect2.example.net/%1%2%%3%4%5%6%7%8%9%0%0%% + +{+fast-redirects{simple-check}} +# Redirected URL = http://redirect2.example.net/blafasel?x=http://redirected.example.net/¶meter1=part-of-the-redirected-url1¶meter2=part-of-the-redirected-url1 +# Redirect Destination = http://redirected.example.net/¶meter1=part-of-the-redirected-url1¶meter2=part-of-the-redirected-url1 +redirect2.example.net/ + diff -Nru privoxy-3.0.17/ssplit.c privoxy-3.0.19/ssplit.c --- privoxy-3.0.17/ssplit.c 2009-06-21 19:21:14.000000000 +0000 +++ privoxy-3.0.19/ssplit.c 2011-09-04 11:10:56.000000000 +0000 @@ -1,4 +1,4 @@ -const char ssplit_rcs[] = "$Id: ssplit.c,v 1.10 2009/05/16 13:27:20 fabiankeil Exp $"; +const char ssplit_rcs[] = "$Id: ssplit.c,v 1.12 2011/09/04 11:10:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/ssplit.c,v $ @@ -9,10 +9,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -63,18 +63,18 @@ * 3 : vec[] = results vector (aka. array) [out] * 4 : vec_len = number of usable slots in the vector (aka. array size) * 5 : dont_save_empty_fields = zero if consecutive delimiters - * give a null output field(s), nonzero if they are just + * give a null output field(s), nonzero if they are just * to be considered as single delimeter * 6 : ignore_leading = nonzero to ignore leading field * separators. * - * Returns : -1 => Error: vec_len is too small to hold all the + * Returns : -1 => Error: vec_len is too small to hold all the * data, or str == NULL. * >=0 => the number of fields put in `vec'. * On error, vec and str may still have been overwritten. * *********************************************************************/ -int ssplit(char *str, const char *delim, char *vec[], int vec_len, +int ssplit(char *str, const char *delim, char *vec[], size_t vec_len, int dont_save_empty_fields, int ignore_leading) { unsigned char is_delim[256]; @@ -122,7 +122,7 @@ || (is_delim[(unsigned)(unsigned char)*str] == 0) ) { /* - * We want empty fields, or the first character in this + * We want empty fields, or the first character in this * field is not a delimiter or the end of string. * So save it. */ @@ -130,24 +130,24 @@ { return(-1); /* overflow */ } - vec[vec_count++] = (char *) str; + vec[vec_count++] = (char *) str; } while ((char_type = is_delim[(unsigned)(unsigned char)*str]) != 2) { - if (char_type == 1) + if (char_type == 1) { /* the char is a separator */ /* null terminate the substring */ - *str++ = '\0'; + *str++ = '\0'; /* Check if we want to save this field */ if ( (!dont_save_empty_fields) || (is_delim[(unsigned)(unsigned char)*str] == 0) ) { /* - * We want empty fields, or the first character in this + * We want empty fields, or the first character in this * field is not a delimiter or the end of string. * So save it. */ @@ -155,7 +155,7 @@ { return(-1); /* overflow */ } - vec[vec_count++] = (char *) str; + vec[vec_count++] = (char *) str; } } else diff -Nru privoxy-3.0.17/ssplit.h privoxy-3.0.19/ssplit.h --- privoxy-3.0.17/ssplit.h 2009-06-21 19:21:14.000000000 +0000 +++ privoxy-3.0.19/ssplit.h 2011-09-04 11:10:56.000000000 +0000 @@ -1,6 +1,6 @@ #ifndef SSPLIT_H_INCLUDED #define SSPLIT_H_INCLUDED -#define SSPLIT_H_VERSION "$Id: ssplit.h,v 1.8 2009/05/16 13:27:20 fabiankeil Exp $" +#define SSPLIT_H_VERSION "$Id: ssplit.h,v 1.10 2011/09/04 11:10:56 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/ssplit.h,v $ @@ -11,10 +11,10 @@ * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written - * by and Copyright (C) 1997 Anonymous Coders and + * by and Copyright (C) 1997 Anonymous Coders and * Junkbusters Corporation. http://www.junkbusters.com * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -39,7 +39,7 @@ extern "C" { #endif -extern int ssplit(char *str, const char *delim, char *vec[], int vec_len, +extern int ssplit(char *str, const char *delim, char *vec[], size_t vec_len, int dont_save_empty_fields, int ignore_leading); /* Revision control strings from this header and associated .c file */ diff -Nru privoxy-3.0.17/templates/blocked privoxy-3.0.19/templates/blocked --- privoxy-3.0.17/templates/blocked 2008-03-01 13:45:45.000000000 +0000 +++ privoxy-3.0.19/templates/blocked 2011-09-04 11:09:15.000000000 +0000 @@ -13,7 +13,7 @@ # # Template files are written in plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -28,7 +28,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -82,7 +82,7 @@ # force-support: # Privoxy has been compiled with support for forced loading # of blocked content. In that case, the symbol "force-prefix" is -# avaiable, which translates to the FORCE_PREFIX +# avaiable, which translates to the FORCE_PREFIX # @@ -107,20 +107,20 @@ minWidth = 650; minHeight = 330; - /* + /* * Navigator, Mozilla, Opera */ - if (window.innerWidth - && (window.innerWidth >= minWidth) + if (window.innerWidth + && (window.innerWidth >= minWidth) && (window.innerHeight >= minHeight)) { return false; } - - /* + + /* * MSIE */ - else if (document.body && document.body.clientWidth + else if (document.body && document.body.clientWidth && (document.body.clientWidth >= minWidth) && (document.body.clientHeight >= minHeight)) { diff -Nru privoxy-3.0.17/templates/cgi-error-404 privoxy-3.0.19/templates/cgi-error-404 --- privoxy-3.0.17/templates/cgi-error-404 2007-01-23 15:56:14.000000000 +0000 +++ privoxy-3.0.19/templates/cgi-error-404 2011-09-04 11:09:15.000000000 +0000 @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -84,7 +84,7 @@ 404 - + #include mod-title @@ -142,7 +142,7 @@ - + diff -Nru privoxy-3.0.17/templates/cgi-error-bad-param privoxy-3.0.19/templates/cgi-error-bad-param --- privoxy-3.0.17/templates/cgi-error-bad-param 2007-01-23 15:56:35.000000000 +0000 +++ privoxy-3.0.19/templates/cgi-error-bad-param 2011-09-04 11:09:15.000000000 +0000 @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -149,7 +149,7 @@ - + diff -Nru privoxy-3.0.17/templates/cgi-error-disabled privoxy-3.0.19/templates/cgi-error-disabled --- privoxy-3.0.17/templates/cgi-error-disabled 2007-11-11 12:41:39.000000000 +0000 +++ privoxy-3.0.19/templates/cgi-error-disabled 2011-09-04 11:09:15.000000000 +0000 @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -162,7 +162,7 @@ - + diff -Nru privoxy-3.0.17/templates/cgi-error-file privoxy-3.0.19/templates/cgi-error-file --- privoxy-3.0.17/templates/cgi-error-file 2007-04-06 15:43:52.000000000 +0000 +++ privoxy-3.0.19/templates/cgi-error-file 2011-09-04 11:09:15.000000000 +0000 @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # diff -Nru privoxy-3.0.17/templates/cgi-error-file-read-only privoxy-3.0.19/templates/cgi-error-file-read-only --- privoxy-3.0.17/templates/cgi-error-file-read-only 2007-01-23 15:02:40.000000000 +0000 +++ privoxy-3.0.19/templates/cgi-error-file-read-only 2011-09-04 11:09:15.000000000 +0000 @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # diff -Nru privoxy-3.0.17/templates/cgi-error-modified privoxy-3.0.19/templates/cgi-error-modified --- privoxy-3.0.17/templates/cgi-error-modified 2007-01-23 15:56:50.000000000 +0000 +++ privoxy-3.0.19/templates/cgi-error-modified 2011-09-04 11:09:15.000000000 +0000 @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -109,7 +109,7 @@

Possible causes:

  • If you got here using your browser's "back" button, then - that is deliberately disabled for this page. Please + that is deliberately disabled for this page. Please navigate around the configuration editor using the links provided.
  • Perhaps you've got more than one browser window open, and @@ -117,7 +117,7 @@ only have one editor window open at a time. Your other edit window should continue to function.
  • You may have modified the file some other way - perhaps by - editing it with a text editor. Simply go back in to the + editing it with a text editor. Simply go back in to the configuration interface using the links below.

You can go back into the edit interface using the menu below, @@ -150,7 +150,7 @@ - + diff -Nru privoxy-3.0.17/templates/cgi-error-parse privoxy-3.0.19/templates/cgi-error-parse --- privoxy-3.0.17/templates/cgi-error-parse 2007-01-23 15:03:49.000000000 +0000 +++ privoxy-3.0.19/templates/cgi-error-parse 2011-09-04 11:09:15.000000000 +0000 @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -110,7 +110,7 @@ editor. If you managed to take a valid file and break it this badly using the web-based editor, please file a bug report!

When you've fixed the problem, you can go back into the edit - interface using the menu below, or by clicking here.

@@ -169,7 +169,7 @@ - + diff -Nru privoxy-3.0.17/templates/cgi-style.css privoxy-3.0.19/templates/cgi-style.css --- privoxy-3.0.17/templates/cgi-style.css 2009-05-16 13:27:21.000000000 +0000 +++ privoxy-3.0.19/templates/cgi-style.css 2011-09-04 11:09:40.000000000 +0000 @@ -10,7 +10,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -33,7 +33,7 @@ /* * CSS for Privoxy CGI and script output * - * $Id: cgi-style.css,v 1.13 2009/05/16 13:27:21 fabiankeil Exp $ + * $Id: cgi-style.css,v 1.14 2011/09/04 11:09:40 fabiankeil Exp $ */ /* @@ -146,6 +146,6 @@ /* * Let the URL and pattern input fields scale with the browser * width and try to prevent vertical scroll bars if the width - * is less than 80 characters. + * is less than 80 characters. */ input.url, input.pattern { width: 95%; } diff -Nru privoxy-3.0.17/templates/connect-failed privoxy-3.0.19/templates/connect-failed --- privoxy-3.0.17/templates/connect-failed 2007-01-25 11:36:36.000000000 +0000 +++ privoxy-3.0.19/templates/connect-failed 2011-09-04 11:09:15.000000000 +0000 @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -94,7 +94,7 @@ 503 - + #include mod-title diff -Nru privoxy-3.0.17/templates/default privoxy-3.0.19/templates/default --- privoxy-3.0.17/templates/default 2007-01-23 15:34:49.000000000 +0000 +++ privoxy-3.0.19/templates/default 2011-09-04 11:09:15.000000000 +0000 @@ -8,7 +8,7 @@ # # Template files are written win plain HTML, with a few # additions: -# +# # - Lines that start with a '#' character like this one # are ignored # @@ -23,7 +23,7 @@ # strings @if-start and if--end@. The strings # should be placed in HTML comments (), so the # html structure won't be messed when the magic happens. -# +# # USABLE SYMBOLS IN THIS TEMPLATE: # -------------------------------- # @@ -124,7 +124,7 @@ - + diff -Nru privoxy-3.0.17/templates/edit-actions-add-url-form privoxy-3.0.19/templates/edit-actions-add-url-form --- privoxy-3.0.17/templates/edit-actions-add-url-form 2009-05-16 13:10:36.000000000 +0000 +++ privoxy-3.0.19/templates/edit-actions-add-url-form 2011-09-04 11:09:15.000000000 +0000 @@ -11,7 +11,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at diff -Nru privoxy-3.0.17/templates/edit-actions-for-url privoxy-3.0.19/templates/edit-actions-for-url --- privoxy-3.0.17/templates/edit-actions-for-url 2010-07-05 17:29:12.000000000 +0000 +++ privoxy-3.0.19/templates/edit-actions-for-url 2011-09-04 11:09:15.000000000 +0000 @@ -4,7 +4,7 @@ # # Purpose : Template used to edit the actions associated with a # particular section in an actions file. -# +# # # Copyright : Written by and Copyright (C) 2001-2008 the SourceForge # Privoxy team. http://www.privoxy.org/ @@ -12,7 +12,7 @@ # Original Author: Copyright (C) 2001 Jonathan Foster # http://www.jon-foster.co.uk/ # -# This program is free software; you can redistribute it +# This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at @@ -32,33 +32,6 @@ # ############################################################################## # -# Browser support for the JavaScript on this page: -# MS Internet Explorer 5.5 - Tested, Yes -# Netscape 6.0 - Tested, Yes -# Netscape 4.75 - Tested, NO -# Opera 5.12 - Tested, NO -# MS Internet Explorer 4+ - Untested, Yes -# MS IE 3.x, NS3.x - Untested, NO -# Mozilla >=0.6 - Untested, Yes -# -# All browsers should work, you just might not get the pretty DHTML effects. -# -# The effects that only work under the browsers marked "Yes" above are: -# - Text edit boxes that won't have any effect are disabled. -# - Table rows containing additional settings are hidden if the feature in -# question is disabled. -# -# There are major kludges to get around these problems with NS4, but they -# screw up the HTML too much for other browsers. If anyone wants to try, -# here's some descriptions of the kludges: -# http://www.webreference.com/js/tips/991114.html -# http://www.webreference.com/dhtml/column12/outDisplay.html -# -# If you're favorite browser isn't listed, please test and add it. -# -# -############################################################################# -# # Standard support: # # This file currently produces valid HTML 4.01 Strict. @@ -66,7 +39,7 @@ # If you change it, please save the generated page from your web browser # and then upload it to http://validator.w3.org/ for checking. # -############################################################################# +############################################################################## # # Available variables include: # @@ -89,7 +62,7 @@ # image-blocker-param-custom # # -############################################################################# +############################################################################## @@ -378,7 +351,7 @@ id="change_x_forwarded_for_mode_block" @change-x-forwarded-for-param-block@>