[Inteproxy-commits] r11 - trunk

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Nov 16 23:18:19 CET 2006


Author: jan
Date: 2006-11-16 23:18:19 +0100 (Thu, 16 Nov 2006)
New Revision: 11

Modified:
   trunk/ChangeLog
   trunk/proxyconnection.py
Log:
Patch by Thomas Arendsen Hein:
* proxyconnection.py (ProxyHTTPConnection.request):
    "int(port)" instead of just "port", so passing ports really works
    "rest or '/'" instead of "url" to make HTTP/1.0-only servers happy
    (__main__): use sys.argv for passing URL and proxy:port for tests.



Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-11-16 22:14:52 UTC (rev 10)
+++ trunk/ChangeLog	2006-11-16 22:18:19 UTC (rev 11)
@@ -1,5 +1,12 @@
 2006-11-16  Thomas Arendsen Hein <thomas at intevation.de>
 
+	* proxyconnection.py (ProxyHTTPConnection.request):
+	"int(port)" instead of just "port", so passing ports really works
+	"rest or '/'" instead of "url" to make HTTP/1.0-only servers happy
+	(__main__): use sys.argv for passing URL and proxy:port for tests.
+
+2006-11-16  Thomas Arendsen Hein <thomas at intevation.de>
+
 	* proxyconnection.py: New. urrlib2 opener for SSL proxy (CONNECT)
 
 2006-11-16  Jan-Oliver Wagner  <jan-oliver.wagner at intevation.de>

Modified: trunk/proxyconnection.py
===================================================================
--- trunk/proxyconnection.py	2006-11-16 22:14:52 UTC (rev 10)
+++ trunk/proxyconnection.py	2006-11-16 22:18:19 UTC (rev 11)
@@ -42,8 +42,8 @@
             except KeyError:
                 raise ValueError, "unknown protocol for: %s" % url
         self._real_host = host
-        self._real_port = port
-        httplib.HTTPConnection.request(self, method, url, body, headers)
+        self._real_port = int(port)
+        httplib.HTTPConnection.request(self, method, rest or '/', body, headers)
 
 
     def connect(self):
@@ -99,7 +99,7 @@
 
     opener = urllib2.build_opener(ConnectHTTPHandler, ConnectHTTPSHandler)
     urllib2.install_opener(opener)
-    req = urllib2.Request(url='https://192.168.1.1')
-    req.set_proxy('192.168.1.254:3128', 'https')
+    req = urllib2.Request(url=sys.argv[1])
+    req.set_proxy(sys.argv[2], 'https')
     f = urllib2.urlopen(req)
     print f.read()



More information about the Inteproxy-commits mailing list