Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment of basic features #1

Merged
merged 15 commits into from Apr 17, 2024
Merged

Deployment of basic features #1

merged 15 commits into from Apr 17, 2024

Conversation

mux99
Copy link
Owner

@mux99 mux99 commented Mar 21, 2024

this PR as for objective to simply add the basic functionality of the app

to be noted:

  • since we need the connection to stay in MPTCP no proxy can currently be used. which is not a good practice, and will have to be remedied in the future.
  • it is not pretty for production use but both Python and the WSGI apps currently lacks the support for MPTCP that would be required to simply enable MPTCP in the app.

flask_app/app.py Outdated
port = request.environ.get('REMOTE_PORT')
mptcp = False

conn = list(filter(None, check_output(["ss", "-Mt", "-n"]).decode("ascii").split('\n')))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use -H to remove the header.
You can also use a filter at the end, not to have to list all connections, just the one you want:

ss -MtnH src {addr} sport {port}

Rendered webpage with connection status and MPTCP version if established.
"""

addr = request.remote_addr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does it display a v6 address? In ss, it surrounds it with [], you might need to handle that.

(to check if it is a v6 address, simply look for : in the address)

flask_app/app.py Outdated
conn = list(filter(None, check_output(["ss", "-Mt", "-n"]).decode("ascii").split('\n')))
for c in conn:
args = list(filter(None, c.split(' ')))
if (args[-1] == f"{addr}:{port}" and args[0] == "mptcp"):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be good to check if the entry is in the list → if not a different error.

So we could have 3 possibilities: MPTCP / TCP / Error

# print()
return render_template('index.html', state_message=state_message, state_class=state_class)

@app.route('/stream_audio')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need this? Just to have a file to download?

You will need to put the license and the source somewhere to avoid troubles... (even if we can use it)

}

.loading {
background-color: #f0ad4e; /* Couleur orange pour le chargement */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I quote "who put comments in French in their code???"

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-_-'

@matttbe
Copy link

matttbe commented Mar 26, 2024

@mux99 @CrapsDorian : if it is easy to do, it might be good to have a specific reply when curl is used, e.g. by checking if the user-agent starts with curl. In this case, no need to reply with a full HTML body, just a MPTCP is being used.

That's what we have when we do a curl multipath-tcp.org. Be careful, it only works with MPTCPv0 protocol, the old one, not supported by the new Linux implementation => https://github.com/multipath-tcp/mptcp_net-next/wiki#curl-httpmultipath-tcporg-is-reporting-i-dont-have-mptcp-supported

flask_app/app.py Outdated
try:
conn = check_output(["ss", "-MtnH", "src", f"{addr}", "sport", f"{port}"]).decode("ascii")
if (conn == ""):
pass
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to do something here, raise an exception or:

if not conn:
    (...)
elif (...) == "mptcp":
    (...)
else:
    (...)

mux99 and others added 3 commits March 27, 2024 16:45
protocol was missing form config, causing server to use the wrong one by default
@matttbe
Copy link

matttbe commented Apr 2, 2024

We still need to check if it works in IPv6.

@matttbe
Copy link

matttbe commented Apr 2, 2024

And the service should not stop, but be detached.

@mux99 mux99 merged commit 1593a16 into main Apr 17, 2024
@mux99 mux99 deleted the dev branch April 17, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants