doesnt work?

Trying to add a Flask web script so I can start adding on a log in and log out script that would allow users to to by pass the proxy when needed. I am using the newest flask and version 2.0.1 of mitmproxy.

app = Flask(“name”) <-- under the flask examples it shows this, should I change this to something else?

def home():
if not session.get(‘logged_in’):
return render_template(‘login.html’)
return “Hello Boss! Logout

@app.route(’/login’, methods=[‘POST’])
def do_admin_login():
if request.form[‘password’] == ‘password’ and request.form[‘username’] == ‘admin’:
session[‘logged_in’] = True
flash(‘wrong password!’)
return home()

def logout():
session[‘logged_in’] = False
return home()

def start():
return wsgiapp.WSGIApp(app, “settings”, 4000) <–following the examples it shows something like this, but I am sure this isn’t right.


The example script works for me as-is, although some browsers seem to dislike domains without TLD. Can you verify that that’s the case for you as well?