コード例 #1
0
def test_format_flow():
    flows = [
        tflow.tflow(resp=True),
        tflow.tflow(err=True),
        tflow.ttcpflow(),
        tflow.ttcpflow(err=True),
    ]
    for f in flows:
        for render_mode in common.RenderMode:
            assert common.format_flow(f, render_mode=render_mode)
            assert common.format_flow(f, render_mode=render_mode, hostheader=True, focused=False)
コード例 #2
0
 def sig_flow_change(self, sender, flow):
     if flow == self.flow:
         self._w = common.format_flow(
             flow,
             False,
             extended=True,
             hostheader=self.master.options.showhost)
コード例 #3
0
ファイル: flowview.py プロジェクト: MatthewShao/mitmproxy
 def sig_flow_change(self, sender, flow):
     if flow == self.flow:
         self._w = common.format_flow(
             flow,
             False,
             extended=True,
             hostheader=self.master.options.showhost
         )
コード例 #4
0
ファイル: flowlist.py プロジェクト: YangjunZ/mitmproxy
 def get_text(self):
     cols, _ = self.master.ui.get_cols_rows()
     return common.format_flow(
         self.flow,
         self.flow is self.master.view.focus.flow,
         hostheader=self.master.options.showhost,
         max_url_len=cols,
     )
コード例 #5
0
 def get_text(self):
     cols, _ = self.master.ui.get_cols_rows()
     return common.format_flow(
         self.flow,
         self.flow is self.master.view.focus.flow,
         hostheader=self.master.options.showhost,
         max_url_len=cols,
     )
コード例 #6
0
 def get_text(self):
     cols, _ = self.master.ui.get_cols_rows()
     return common.format_flow(
         self.flow,
         self.flow is self.master.view.focus.flow,
         hostheader=self.master.options.showhost,
         cols=cols,
         layout=self.master.options.console_flowlist_layout
     )
コード例 #7
0
 def __init__(self, master: "mitmproxy.console.master.ConsoleMaster",
              f: http.HTTPFlow):
     self.master = master
     self.flow = f
     self._w = common.format_flow(f,
                                  False,
                                  extended=True,
                                  hostheader=self.master.options.showhost)
     signals.flow_change.connect(self.sig_flow_change)
コード例 #8
0
 def focus_changed(self):
     if self.master.view.focus.flow:
         self._w = common.format_flow(
             self.master.view.focus.flow,
             False,
             extended=True,
             hostheader=self.master.options.showhost)
     else:
         self._w = urwid.Pile([])
コード例 #9
0
 def focus_changed(self):
     cols, _ = self.master.ui.get_cols_rows()
     if self.master.view.focus.flow:
         self._w = common.format_flow(
             self.master.view.focus.flow,
             render_mode=common.RenderMode.DETAILVIEW,
             hostheader=self.master.options.showhost,
         )
     else:
         self._w = urwid.Pile([])
コード例 #10
0
ファイル: flowview.py プロジェクト: MatthewShao/mitmproxy
 def __init__(self, master: "mitmproxy.console.master.ConsoleMaster", f: http.HTTPFlow):
     self.master = master
     self.flow = f
     self._w = common.format_flow(
         f,
         False,
         extended=True,
         hostheader=self.master.options.showhost
     )
     signals.flow_change.connect(self.sig_flow_change)
コード例 #11
0
ファイル: flowview.py プロジェクト: davidpshaw/mitmproxy
 def focus_changed(self):
     if self.master.view.focus.flow:
         self._w = common.format_flow(
             self.master.view.focus.flow,
             False,
             extended=True,
             hostheader=self.master.options.showhost
         )
     else:
         self._w = urwid.Pile([])
コード例 #12
0
 def focus_changed(self):
     cols, _ = self.master.ui.get_cols_rows()
     if self.master.view.focus.flow:
         self._w = common.format_flow(
             self.master.view.focus.flow,
             False,
             extended=True,
             hostheader=self.master.options.showhost,
             max_url_len=cols,
         )
     else:
         self._w = urwid.Pile([])
コード例 #13
0
 def focus_changed(self):
     cols, _ = self.master.ui.get_cols_rows()
     if self.master.view.focus.flow:
         self._w = common.format_flow(
             self.master.view.focus.flow,
             False,
             extended=True,
             hostheader=self.master.options.showhost,
             cols=cols,
             layout=self.master.options.console_flowlist_layout)
     else:
         self._w = urwid.Pile([])
コード例 #14
0
ファイル: flowview.py プロジェクト: cortesi/mitmproxy
 def focus_changed(self):
     cols, _ = self.master.ui.get_cols_rows()
     if self.master.view.focus.flow:
         self._w = common.format_flow(
             self.master.view.focus.flow,
             False,
             extended=True,
             hostheader=self.master.options.showhost,
             max_url_len=cols,
         )
     else:
         self._w = urwid.Pile([])
コード例 #15
0
ファイル: flowlist.py プロジェクト: wangwq5038/HogwartsTest15
    def get_text(self):
        cols, _ = self.master.ui.get_cols_rows()
        layout = self.master.options.console_flowlist_layout
        if layout == "list" or (layout == 'default' and cols < 100):
            render_mode = common.RenderMode.LIST
        else:
            render_mode = common.RenderMode.TABLE

        return common.format_flow(
            self.flow,
            render_mode=render_mode,
            focused=self.flow is self.master.view.focus.flow,
            hostheader=self.master.options.showhost,
        )
コード例 #16
0
ファイル: test_common.py プロジェクト: cortesi/mitmproxy
def test_format_flow():
    f = tflow.tflow(resp=True)
    assert common.format_flow(f, True)
    assert common.format_flow(f, True, hostheader=True)
    assert common.format_flow(f, True, extended=True)
コード例 #17
0
def test_format_flow():
    f = tflow.tflow(resp=True)
    assert common.format_flow(f, True)
    assert common.format_flow(f, True, hostheader=True)
    assert common.format_flow(f, True, extended=True)