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

can't use debug=True and host='0.0.0.0' if flask app integrated with PyWebIO #231

Open
changfu2021 opened this issue Dec 9, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@changfu2021
Copy link

BUG Description

1, parameter host='0.0.0.0' can not be used but "localhost" works if original Flask application integrated with PyWebIO.
2, papameter debug=True can not be used too,
in my application, below parameter works:
app.run(host='localhost', port=5000, ssl_context=("localhost_cert.pem", "localhost_key.pem"))
details see the pictures i marked

Environment Information

  • OS and Version: Windows10 +latest Pycharm PyCharm 2021.3 (Community Edition)
  • Browser and Version: Chrome96
  • Python Version: python3.1
  • PyWebIO Version: 1.5

1

2

3

@changfu2021 changfu2021 added the bug Something isn't working label Dec 9, 2021
@wang0618
Copy link
Member

wang0618 commented Dec 9, 2021

Does the Flask server work good when you remove the app.add_url_rule() line ?

@changfu2021
Copy link
Author

Does the Flask server work good when you remove the app.add_url_rule() line ?

I tried delete the app.add_url_rule() line,
and if host='0.0.0.0',
then the server can start but can not be visit

@wang0618
Copy link
Member

wang0618 commented Dec 9, 2021

It seems that there are some problems with the ssl_context config. Please make sure your Flask app can work well first, and then add PyWebIO app to it via app.add_url_rule()

@changfu2021
Copy link
Author

so i tried to remove the ssl_context parameter, and add debug=True, it become this:
app.run(debug=True,host='localhost', port=5000)
it still not work,the server can not be started:

  • Serving Flask app '' (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: on
  • Restarting with stat

stopped here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants