Loads a flow
(self, f)
| 123 | ) |
| 124 | |
| 125 | async def load_flow(self, f): |
| 126 | """ |
| 127 | Loads a flow |
| 128 | """ |
| 129 | |
| 130 | if ( |
| 131 | isinstance(f, http.HTTPFlow) |
| 132 | and len(self.options.mode) == 1 |
| 133 | and self.options.mode[0].startswith("reverse:") |
| 134 | ): |
| 135 | # When we load flows in reverse proxy mode, we adjust the target host to |
| 136 | # the reverse proxy destination for all flows we load. This makes it very |
| 137 | # easy to replay saved flows against a different host. |
| 138 | # We may change this in the future so that clientplayback always replays to the first mode. |
| 139 | mode = ReverseMode.parse(self.options.mode[0]) |
| 140 | assert isinstance(mode, ReverseMode) |
| 141 | f.request.host, f.request.port, *_ = mode.address |
| 142 | f.request.scheme = mode.scheme |
| 143 | |
| 144 | for e in eventsequence.iterate(f): |
| 145 | await self.addons.handle_lifecycle(e) |
no test coverage detected