mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
sans-io compat++
This commit is contained in:
parent
98f060d019
commit
739b5b0b74
@ -9,7 +9,7 @@ from mitmproxy.utils import human
|
||||
|
||||
class TermStatus:
|
||||
def running(self):
|
||||
if ctx.options.server:
|
||||
if ctx.master.server.bound:
|
||||
ctx.log.info(
|
||||
"Proxy server listening at http://{}".format(
|
||||
human.format_address(ctx.master.server.address)
|
||||
|
@ -6,6 +6,7 @@ from mitmproxy import connections
|
||||
from mitmproxy import controller, exceptions # noqa
|
||||
from mitmproxy import stateobject
|
||||
from mitmproxy import version
|
||||
from mitmproxy.utils import compat
|
||||
|
||||
|
||||
class Error(stateobject.StateObject):
|
||||
@ -63,8 +64,8 @@ class Flow(stateobject.StateObject):
|
||||
def __init__(
|
||||
self,
|
||||
type: str,
|
||||
client_conn: connections.ClientConnection,
|
||||
server_conn: connections.ServerConnection,
|
||||
client_conn: compat.Client,
|
||||
server_conn: compat.Server,
|
||||
live: bool=None
|
||||
) -> None:
|
||||
self.type = type
|
||||
@ -84,8 +85,8 @@ class Flow(stateobject.StateObject):
|
||||
_stateobject_attributes = dict(
|
||||
id=str,
|
||||
error=Error,
|
||||
client_conn=connections.ClientConnection,
|
||||
server_conn=connections.ServerConnection,
|
||||
client_conn=compat.Client,
|
||||
server_conn=compat.Server,
|
||||
type=str,
|
||||
intercepted=bool,
|
||||
is_replay=str,
|
||||
|
@ -10,6 +10,7 @@ async def test_configure():
|
||||
ts = termstatus.TermStatus()
|
||||
with taddons.context() as ctx:
|
||||
ctx.master.server = proxy.DummyServer()
|
||||
ctx.master.server.bound = True
|
||||
ctx.configure(ts, server=False)
|
||||
ts.running()
|
||||
ctx.configure(ts, server=True)
|
||||
|
Loading…
Reference in New Issue
Block a user