| 544 | nl.layer = layr |
| 545 | |
| 546 | def request(flow: http.HTTPFlow): |
| 547 | if "cached" in flow.request.path: |
| 548 | flow.response = http.Response.make(418, f"(cached) {flow.request.text}") |
| 549 | if "toggle-tls" in flow.request.path: |
| 550 | if flow.request.url.startswith("https://"): |
| 551 | flow.request.url = flow.request.url.replace("https://", "http://") |
| 552 | else: |
| 553 | flow.request.url = flow.request.url.replace("http://", "https://") |
| 554 | if "redirect" in flow.request.path: |
| 555 | flow.request.host = "httpbin.org" |
| 556 | |
| 557 | def tls_start_client(tls_start: tls.TlsData): |
| 558 | # INSECURE |