aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy.py
diff options
context:
space:
mode:
authorHenrik Nordstrom <henrik@henriknordstrom.net>2011-02-08 15:07:29 +0100
committerHenrik Nordstrom <henrik@henriknordstrom.net>2011-02-10 02:59:51 +0100
commit0613321aefa4cdc63e801fc0392ed5ae84e97502 (patch)
treeb658548a7b4fce391d0112e8d330b1ef71619df8 /libmproxy/proxy.py
parent4cf3392e50da9b5d45027e707c0db5844b93d628 (diff)
downloadmitmproxy-0613321aefa4cdc63e801fc0392ed5ae84e97502.tar.gz
mitmproxy-0613321aefa4cdc63e801fc0392ed5ae84e97502.tar.bz2
mitmproxy-0613321aefa4cdc63e801fc0392ed5ae84e97502.zip
Optimize CONNECT responses, sent in a single packet
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r--libmproxy/proxy.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index c08040e6..b879a405 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -407,9 +407,11 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
d = self.rfile.readline()
if not d.strip():
break
- self.wfile.write('HTTP/1.1 200 Connection established\r\n')
- self.wfile.write('Proxy-agent: %s\r\n'%NAME)
- self.wfile.write('\r\n')
+ self.wfile.write(
+ 'HTTP/1.1 200 Connection established\r\n' +
+ ('Proxy-agent: %s\r\n'%NAME) +
+ '\r\n'
+ )
self.wfile.flush()
self.connection = ssl.wrap_socket(
self.connection,