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

Using WSGI server (like Gunicorn) with Flask-Gopher #13

Open
tyteen4a03 opened this issue Sep 25, 2022 · 1 comment
Open

Using WSGI server (like Gunicorn) with Flask-Gopher #13

tyteen4a03 opened this issue Sep 25, 2022 · 1 comment

Comments

@tyteen4a03
Copy link

Hi, very nice library. Could you confirm whether it's possible to serve this application behind a WSGI server, and how?

@michael-lazar
Copy link
Owner

Hi,

Because WSGI servers only know how to handle HTTP traffic, you need to teach them to "speak" gopher. For the built-in Flask server (i.e. werkzeug), this is what I am doing with the GopherRequestHandler class.

https://github.com/michael-lazar/flask-gopher/blob/master/flask_gopher/flask_gopher.py#L591

Werkzeug is nice because it allows you to override the request handling with a simple python class. For production-grade servers like gunicorn I would guess that it's not so simple, but I haven't really looked into it.

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

No branches or pull requests

2 participants