diff --git a/cli/onionshare_cli/web/web.py b/cli/onionshare_cli/web/web.py index 7408046b..ab47195c 100644 --- a/cli/onionshare_cli/web/web.py +++ b/cli/onionshare_cli/web/web.py @@ -360,13 +360,18 @@ class Web: # Shutdown the flask service try: func = request.environ.get("werkzeug.server.shutdown") - if func is None: + if func is None and self.mode != "chat": raise RuntimeError("Not running with the Werkzeug Server") func() except: pass + self.running = False + # If chat, shutdown the socket server + if self.mode == "chat": + self.socketio.stop() + def start(self, port): """ Start the flask web server.