mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
Merge branch 'master' of ssh.github.com:mitmproxy/mitmproxy
This commit is contained in:
commit
7439e244a6
@ -30,7 +30,7 @@ class MyMaster(flow.FlowMaster):
|
||||
f = flow.FlowMaster.handle_response(self, f)
|
||||
if f:
|
||||
f.reply()
|
||||
print f
|
||||
print(f)
|
||||
return f
|
||||
|
||||
|
||||
|
@ -251,4 +251,4 @@ def print_attributes(obj, filter_string=None, hide_privates=False):
|
||||
if filter_string is not None and filter_string not in attr:
|
||||
continue
|
||||
value = getattr(obj, attr)
|
||||
print "%s.%s" % ('obj', attr), value, type(value)
|
||||
print("%s.%s" % ('obj', attr), value, type(value))
|
||||
|
@ -32,14 +32,14 @@ class Wrapper(object):
|
||||
return dict([re.findall(r'([^:]+): (.*)', line)[0] for line in state])
|
||||
|
||||
def enable_proxy_for_service(self, service):
|
||||
print 'Enabling proxy on {}...'.format(service)
|
||||
print('Enabling proxy on {}...'.format(service))
|
||||
for subcommand in ['-setwebproxy', '-setsecurewebproxy']:
|
||||
self.run_networksetup_command(
|
||||
subcommand, service, '127.0.0.1', str(
|
||||
self.port))
|
||||
|
||||
def disable_proxy_for_service(self, service):
|
||||
print 'Disabling proxy on {}...'.format(service)
|
||||
print('Disabling proxy on {}...'.format(service))
|
||||
for subcommand in ['-setwebproxystate', '-setsecurewebproxystate']:
|
||||
self.run_networksetup_command(subcommand, service, 'Off')
|
||||
|
||||
@ -129,7 +129,7 @@ class Wrapper(object):
|
||||
@classmethod
|
||||
def ensure_superuser(cls):
|
||||
if os.getuid() != 0:
|
||||
print 'Relaunching with sudo...'
|
||||
print('Relaunching with sudo...')
|
||||
os.execv('/usr/bin/sudo', ['/usr/bin/sudo'] + sys.argv)
|
||||
|
||||
@classmethod
|
||||
|
@ -4,6 +4,6 @@ from libmproxy.script import concurrent
|
||||
|
||||
@concurrent # Remove this and see what happens
|
||||
def request(context, flow):
|
||||
print "handle request: %s%s" % (flow.request.host, flow.request.path)
|
||||
print("handle request: %s%s" % (flow.request.host, flow.request.path))
|
||||
time.sleep(5)
|
||||
print "start request: %s%s" % (flow.request.host, flow.request.path)
|
||||
print("start request: %s%s" % (flow.request.host, flow.request.path))
|
||||
|
@ -14,6 +14,6 @@ with open("logfile", "rb") as logfile:
|
||||
print(f)
|
||||
print(f.request.host)
|
||||
json.dump(f.get_state(), sys.stdout, indent=4)
|
||||
print ""
|
||||
print("")
|
||||
except flow.FlowReadError as v:
|
||||
print "Flow file corrupted. Stopped loading."
|
||||
|
@ -371,7 +371,7 @@ class TransparentProxy(object):
|
||||
if server:
|
||||
packet.src_addr, packet.src_port = server
|
||||
else:
|
||||
print "Warning: Previously unseen connection from proxy to %s:%s." % client
|
||||
print("Warning: Previously unseen connection from proxy to %s:%s." % client)
|
||||
|
||||
packet = self.driver.update_packet_checksums(packet)
|
||||
self.response_handle.send((packet.raw, metadata))
|
||||
|
@ -60,10 +60,10 @@ By default tnetstrings work only with byte strings, not unicode. If you want
|
||||
unicode strings then pass an optional encoding to the various functions,
|
||||
like so::
|
||||
|
||||
>>> print repr(tnetstring.loads("2:\\xce\\xb1,"))
|
||||
>>> print(repr(tnetstring.loads("2:\\xce\\xb1,")))
|
||||
'\\xce\\xb1'
|
||||
>>>
|
||||
>>> print repr(tnetstring.loads("2:\\xce\\xb1,","utf8"))
|
||||
>>> print(repr(tnetstring.loads("2:\\xce\\xb1,","utf8")))
|
||||
u'\u03b1'
|
||||
|
||||
"""
|
||||
|
@ -232,7 +232,7 @@ class Settings(RequestHandler):
|
||||
self.state.set_intercept(v)
|
||||
update[k] = v
|
||||
else:
|
||||
print "Warning: Unknown setting {}: {}".format(k, v)
|
||||
print("Warning: Unknown setting {}: {}".format(k, v))
|
||||
|
||||
ClientConnection.broadcast(
|
||||
type="settings",
|
||||
|
Loading…
Reference in New Issue
Block a user