MCPcopy
hub / github.com/mitmproxy/mitmproxy / configure

Method configure

examples/contrib/upstream_pac.py:44–62  ·  view source on GitHub ↗
(updated)

Source from the content-addressed store, hash-verified

42
43 @staticmethod
44 def configure(updated) -> None:
45 if "pac_url" in updated:
46 if ctx.options.pac_url is None:
47 UpstreamPac.pac_file = None
48 logging.info("No pac file specified")
49 else:
50 UpstreamPac.pac_file = pypac.get_pac(
51 url=ctx.options.pac_url,
52 allowed_content_types=[
53 "application/x-ns-proxy-autoconfig ",
54 "application/x-javascript-config",
55 "text/html",
56 "text/plain",
57 ],
58 )
59 if UpstreamPac.pac_file is None:
60 logging.error(
61 "Failed to load pac file from: %s", ctx.options.pac_url
62 )
63
64 @staticmethod
65 def proxy_address(flow: http.HTTPFlow) -> tuple[str, tuple[str, int]] | None:

Callers

nothing calls this directly

Calls 2

infoMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected