]> khamidou — GitHub mirrors - tunnel.git/commitdiff
fixing bugs
authorkhamidou <khamidou@gmail.com>
Tue, 8 Dec 2009 19:55:43 +0000 (20:55 +0100)
committerkhamidou <khamidou@gmail.com>
Tue, 8 Dec 2009 19:55:43 +0000 (20:55 +0100)
tunnel.py

index 4f562e029907f8fb0765a00958823a891a6aa30f..ae07d5ab886a5b4c7f653b34f3a4a97baa583015 100755 (executable)
--- 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)