From a7df6e1503551bf15c35252ffe39236221bae739 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 18 Feb 2012 14:45:22 +1300 Subject: Refactor reverse proxying - Retain the specification from the Host header as a Request's description. - Expand upstream proxy specifications to include the scheme. We now say https://hostname:port - Move the "R" revert keybinding to "v" to make room for a reverse proxy binding that matches the command-line flag. --- libmproxy/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libmproxy/utils.py') diff --git a/libmproxy/utils.py b/libmproxy/utils.py index c12ccc9b..f0e31145 100644 --- a/libmproxy/utils.py +++ b/libmproxy/utils.py @@ -161,7 +161,6 @@ def del_all(dict, keys): del dict[key] - def pretty_size(size): suffixes = [ ("B", 2**10), @@ -421,6 +420,13 @@ def parse_url(url): return scheme, host, port, path +def parse_proxy_spec(url): + p = parse_url(url) + if not p: + return None + return p[:3] + + def clean_hanging_newline(t): """ Many editors will silently add a newline to the final line of a -- cgit v1.2.3