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

[Bug]: Flask Server in Termux Requires Focus Switch to Process Requests #4409

Open
Postaczech2021 opened this issue Feb 28, 2025 · 0 comments

Comments

@Postaczech2021
Copy link

Problem description

I'm encountering a strange issue when running a Flask server within Termux on Android. Specifically, when I access the server via 127.0.0.1:5000 in Chrome, the request seems to hang. The browser just waits indefinitely. The request is only processed after I switch back to the Termux app, and then immediately switch back to Chrome. It's as if Termux needs focus to actually process the request from the Flask server. This behavior is obviously undesirable, as I don't want to manually switch between apps for every request.

Has anyone else experienced this? Is it possible that this behavior is due to new security policies implemented in Android 15 (or later versions of Android)?

Steps to reproduce the behavior.

I'm encountering a strange issue when running a Flask server within Termux on Android. Specifically, when I access the server via 127.0.0.1:5000 in Chrome, the request seems to hang. The browser just waits indefinitely. The request is only processed after I switch back to the Termux app, and then immediately switch back to Chrome. It's as if Termux needs focus to actually process the request from the Flask server. This behavior is obviously undesirable, as I don't want to manually switch between apps for every request.

Has anyone else experienced this? Is it possible that this behavior is due to new security policies implemented in Android 15 (or later versions of Android)?

What is the expected behavior?

Without switch between termux and Chrome browser

System information

  • Termux application version:
  • Android OS version:
  • Device model:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant