1:mod:`mozproxy` --- Provides an HTTP proxy
2==========================================
3
4Mozproxy let you launch an HTTP proxy when we need to run tests against
5third-part websites in a reliable and reproducible way.
6
7Mozproxy provides an interface to a proxy software, and the currently
8supported backend is **mitmproxy** for Desktop and Android.
9
10Mozproxy is used by Raptor to run performance test without having to interact
11with the real web site.
12
13Mozproxy provide a function that returns a playback class. The usage pattern is
14::
15
16   from mozproxy import get_playback
17
18   config = {'playback_tool': 'mitmproxy'}
19   pb = get_playback(config)
20   pb.start()
21   try:
22     # do your test
23   finally:
24     pb.stop()
25
26**config** is a dict with the following options:
27
28- **playback_tool**: name of the backend. can be "mitmproxy", "mitmproxy-android"
29- **playback_version**: playback tool version
30- **playback_files**: playback recording path/manifest/URL
31- **binary**: path of the browser binary
32- **obj_path**: build dir
33- **platform**: platform name (provided by mozinfo.os)
34- **run_local**: if True, the test is running locally.
35- **app**: tested app. Can be "firefox",  "geckoview", "refbrow", "fenix" or  "firefox"
36- **host**: hostname for the policies.json file
37- **local_profile_dir**: profile dir
38
39
40Supported environment variables:
41
42- **MOZPROXY_DIR**: directory used by mozproxy for all data files, set by mozproxy
43- **MOZ_UPLOAD_DIR**: upload directory path
44- **GECKO_HEAD_REPOSITORY**: used to find the certutils binary path from the CI
45- **GECKO_HEAD_REV**: used to find the certutils binary path from the CI
46- **HOSTUTILS_MANIFEST_PATH**: used to find the certutils binary path from the CI
47