Closed
Description
Right now when OnionShare starts a web service, it uses app.run to start it directly in flask. I think instead we should launch an nginx subprocess and use that along with gunicorn to host the flask app.
- We already have an issue to use gunicorn (Look into using Gunicorn in front of Flask #1022) instead of flask directly, and this will be much simpler if we use nginx
- If we use nginx, we can get gzip for free and don't need to gzip everything and fill up
/tmp(Allow ability to serve website files directly rather than gzipped copies #1328), and I suspect we could simplify a lot of the web server code in other ways too - If we use nginx, we get simple working range requests (Range requests don't support Tor Browser #1333)
- If we use nginx and implement the download accelerator (speed up downloads #1295) we get much better performance, e.g. quicker download speeds
Before implementing this, I'm not sure how a few things will work:
- Progress bars. If someone downloads a file from nginx, how can we hook into the real-time file transfer to make progress bars work?
- "Stop sharing after files have been sent". How do we know that the files are finished sending?