aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/builtins/onboarding.py
blob: 958440109e06e4726105796fdb5285748a10e1f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from mitmproxy.builtins import wsgiapp
from mitmproxy.builtins.onboardingapp import app


class Onboarding(wsgiapp.WSGIApp):
    def __init__(self):
        super().__init__(app.Adapter(app.application), None, None)
        self.enabled = False

    def configure(self, options, updated):
        self.host = options.app_host
        self.port = options.app_port
        self.enabled = options.app

    def request(self, f):
        if self.enabled:
            super().request(f)