Test: fix a bug in arg processing for the proxy server

Fixes a typo in arg processing for test script proxy2.py.
Also removes an outdated comment and clarifies another.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
This commit is contained in:
Sebastien Awwad 2018-09-21 12:14:49 -04:00
parent 2b019f65f7
commit 7288b71917
No known key found for this signature in database
GPG key ID: BC0C6DEDD5E5CC03
2 changed files with 2 additions and 6 deletions

View file

@ -61,7 +61,7 @@ def get_cert_filepath(path):
class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
address_family = socket.AF_INET # MODIFIED
address_family = socket.AF_INET # MODIFIED to use IPv4 instead of IPv6
daemon_threads = True
def handle_error(self, request, client_address):
@ -421,7 +421,7 @@ def test(HandlerClass=ProxyRequestHandler, ServerClass=ThreadingHTTPServer, prot
server_address = ('127.0.0.1', port) # MODIFIED: changed from '::1'
# MODIFIED: Conditional below added to control INTERCEPT setting.
if len(sys.argv > 2):
if len(sys.argv) > 2:
if sys.argv[2].lower() == 'intercept':
global INTERCEPT
INTERCEPT = True

View file

@ -282,10 +282,6 @@ def test_httpS_dl_via_smart_http_proxy(self):
Note that the proxy address is still http://... even though the connection
with the target server is an HTTPS connection. The proxy itself will act as
a TCP proxy via HTTP CONNECT.
TEMPORARY NOTE: It turns out that mitmproxy doesn't support HTTP CONNECT,
so I need a new proxy option for this....
"""
self.set_env_value('HTTP_PROXY', self.http_proxy_addr2) # http as intended
self.set_env_value('HTTPS_PROXY', self.http_proxy_addr2) # http as intended