Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5064

Re: can't get urllib2 or httplib to work with tor & privoxy

Path csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.013
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'library,': 0.05; 'decent': 0.07; 'https': 0.07; 'script,': 0.07; 'python': 0.07; 'sockets': 0.09; 'am,': 0.14; 'request,': 0.14; 'wrote:': 0.14; '503': 0.16; 'dumps': 0.16; 'stdout': 0.16; 'level,': 0.19; 'tue,': 0.20; 'code': 0.22; 'header:In-Reply-To:1': 0.22; 'file,': 0.22; 'received:209.85.214.174': 0.23; 'received:mail- iw0-f174.google.com': 0.23; "what's": 0.24; "i'm": 0.26; "i'll": 0.26; 'chris': 0.27; 'message-id:@mail.gmail.com': 0.28; 'server': 0.29; 'certainly': 0.29; 'language.': 0.31; 'to:addr:python-list': 0.32; 'another': 0.32; 'page': 0.33; 'fairly': 0.33; 'generally': 0.33; 'options': 0.34; 'using': 0.34; 'causing': 0.35; 'client.': 0.35; 'rather': 0.36; 'two': 0.37; 'subject:can': 0.37; 'received:209.85': 0.37; 'exactly': 0.37; 'subject:with': 0.37; 'http': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'unless': 0.38; 'received:209.85.214': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'requests': 0.40; 'would': 0.40; 'header:Received:5': 0.40; 'networking': 0.60; 'subject: & ': 0.61; 'give': 0.61; '2011': 0.62; 'high': 0.66; 'doing.': 0.68; 'easily,': 0.68; 'what,': 0.68; 'tiny': 0.69; 'lynx': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=wGCflXwIRpJ0T0xO+5zUMaiS5/oFTAm3OuDC1BFyHbc=; b=lbycKRVFq5wahWXwnqE3H4Kz4XKZrX6pk7BrmjK4pY8erPPmfUbsOIvP42JuLMgfY+ EZrS+43dREHSpi2g0UDFPuOlh3a002vrN7n1cl9YM/P3zvj1HwBsWo/bGh6KhIcQ+Lbo LDCXINnkCS0PSW05LrpR7A7mwQJS0vRYNWxRU=
DomainKey-Signature a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RKKfGmWLG573HjcMFLO1/Vv13fEtujLctt/3gwXBh8TjwHh0sGVXgT5qIdErpqNEra u+t6p3oRaiiwSg2IaNAiS7/DSVawy4i05ny5TORHQMi32HEQeKJkghRsH4pehBE3pzF5 kQs3dNt4gzB37Mftqv7FfpV0mPr2Rf+uYguzc=
MIME-Version 1.0
In-Reply-To <d5e2985d74a2117de3fd9ab09c99b799@msgid.frell.theremailer.net>
References <d5e2985d74a2117de3fd9ab09c99b799@msgid.frell.theremailer.net>
Date Tue, 10 May 2011 20:33:12 +1000
Subject Re: can't get urllib2 or httplib to work with tor & privoxy
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1378.1305023595.9059.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 82.94.164.166
X-Trace 1305023595 news.xs4all.nl 41114 [::ffff:82.94.164.166]:57510
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:5064

Show key headers only | View raw


On Tue, May 10, 2011 at 4:20 AM, Bob Fnord <bob@example.com> wrote:
> Both methods give me a 503 error...

As a networking geek, my first thought would be to fire up a tiny
little "snoop server" and see what, exactly, the two methods are
doing. (Ignore the HTTPS options as they're more complicated to snoop
on; you're almost certainly going to see exactly the same on the
HTTP.)

A snoop server is simply an HTTP server that dumps its requests to
stdout or a file, utterly raw. You can write one in Python fairly
easily, or use another program; if I'm working on Windows, I'll
generally use my own RosMud MUD client, but you'll be able to whip up
a cross-platform one in half a page of code in any decent high level
language. I recommend you work at the sockets level, rather than using
an HTTP library, unless you have one that can emit the entire request,
exactly as it came from the client.

Once you've found the difference(s) between Lynx and your script, you
can see what's causing the 503 (Service Unavailable) error; it may be
that you need to authenticate with the proxy.

Chris Angelico

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

can't get urllib2 or httplib to work with tor & privoxy Bob Fnord <bob@example.com> - 2011-05-09 20:20 +0200
  Re: can't get urllib2 or httplib to work with tor & privoxy Chris Angelico <rosuav@gmail.com> - 2011-05-10 20:33 +1000
    Re: can't get urllib2 or httplib to work with tor & privoxy Bob Fnord <bob@example.com> - 2011-05-12 17:51 +0200

csiph-web