diff --git a/flask_app/app.py b/flask_app/app.py index eaebd2b..4da00f3 100755 --- a/flask_app/app.py +++ b/flask_app/app.py @@ -32,22 +32,30 @@ def mptcp_status_page(): if ":" in addr: addr = f"{addr}:{port}" + state_info = '' try: conn = check_output(["ss", "-MnH", "dst", f"{addr}", "dport", f"{port}"]).decode("ascii") if conn.startswith("ESTAB"): state_message = 'are' state_class = 'success' + state_info = 'Nice, even your browser is supporting MPTCP!' else: state_message = 'are not' state_class = 'fail' + state_info = 'Your browser is not supporting MPTCP, but maybe your system is, check the cURL command below.' except Exception as e: - state_message = '[error: ' + str(e) + ']' + state_message = 'are maybe, or maybe not (internal error)' state_class = 'error' + state_info = 'Error: ' + str(e) if user.startswith("curl"): return "You " + state_message + " using MPTCP.\n" - return render_template('index.html', state_message=state_message, state_class=state_class, host=host) + return render_template('index.html', + state_message=state_message, + state_class=state_class, + state_info=state_info, + host=host) if __name__ == "__main__": app.run(host="::", port=80, debug=True) diff --git a/flask_app/templates/index.html b/flask_app/templates/index.html index d13f4cd..7a23aad 100644 --- a/flask_app/templates/index.html +++ b/flask_app/templates/index.html @@ -20,6 +20,9 @@
You {{ state_message }} using MPTCP!
++ {{ state_info }} +