From: khamidou Date: Tue, 8 Dec 2009 19:55:43 +0000 (+0100) Subject: fixing bugs X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=cb65590d2e936f990316475778a0bef574872612;p=tunnel.git fixing bugs --- diff --git a/tunnel.py b/tunnel.py index 4f562e0..ae07d5a 100755 --- a/tunnel.py +++ b/tunnel.py @@ -23,9 +23,18 @@ class ProxyHandler (BaseHTTPServer.BaseHTTPRequestHandler): rbufsize = 0 # self.rfile Be unbuffered def do_GET(self): - headers = {"Proxy-Connection" : "", } + headers = {"Proxy-Connection" : "", + "User-Agent" : "Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11", + "Accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "Accept-Language": "fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3", + "Accept-Encoding": "gzip,deflate", + "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", + "Keep-Alive": "300", + "Proxy-Connection": "keep-alive", + + } req = urllib2.Request(self.path, headers=headers) - + print self.headers try: data = urllib2.urlopen(req) self.send_response(200)