yaconsult has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to get the test script below working, but get the error in the title. Am I doing something incorrectly? Do I need to make changes to the privoxy configuration? It's running on CentOS 5.3, if that makes any difference.

I found this post, but wasn't sure how to implement the suggestion, or if that was the actual problem. http://archives.seul.org/or/talk/Jan-2007/msg00156.html

Thanks!

#!/usr/bin/perl -w use strict; use WWW::Mechanize; use HTTP::Cookies; # this script will test to see how WWW::Mechanize works with Tor sub main { my $cookie_jar = HTTP::Cookies->new( file => 'cookies.dat' +, autosave => 1, hide_cookie2 => 1 ); my $bot = WWW::Mechanize->new; $bot->max_redirect(100); $bot->cookie_jar($cookie_jar); $bot->add_header(Accept => 'text/xml,application/xml,application/x +html+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'); $bot->add_header('Accept-Language' => 'en-us,en;q=0.5'); $bot->add_header('Accept-Charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0 +.7'); $bot->add_header('Cache-Control' => 'max-age=0'); # port 8118 for privoxy $bot->proxy(['http', 'https', 'ftp'], 'http://127.0.0.1:8118'); $bot->agent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1. +8.0.3) Gecko/20060426 Firefox/1.5.0.3'); $bot->timeout(600); $bot->stack_depth("3"); my $url = 'http://check.torproject.org/'; my $response = $bot->get($url); my $content = $bot->content; print ("$content"); print ("done"); } &main;
  • Comment on Mechanize/tor/privoxy = 500 Chunked must be last Transfer-Encoding 'identity'
  • Download Code

Replies are listed 'Best First'.
Re: Mechanize/tor/privoxy = 500 Chunked must be last Transfer-Encoding 'identity'
by Anonymous Monk on May 31, 2009 at 08:57 UTC