From 8c012c5ab847f432b4e2993e284d11ccb181731d Mon Sep 17 00:00:00 2001 From: lipku Date: Sun, 5 May 2024 13:18:18 +0800 Subject: [PATCH] add listenport config --- app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 543ef9a..98cc70b 100644 --- a/app.py +++ b/app.py @@ -400,6 +400,8 @@ if __name__ == '__main__': parser.add_argument('--CHARACTER', type=str, default='test') parser.add_argument('--EMOTION', type=str, default='default') + parser.add_argument('--listenport', type=int, default=8000) + opt = parser.parse_args() app.config.from_object(opt) print(app.config) @@ -477,7 +479,7 @@ if __name__ == '__main__': print('start websocket server') #app.on_shutdown.append(on_shutdown) #app.router.add_post("/offer", offer) - server = pywsgi.WSGIServer(('0.0.0.0', 8000), app, handler_class=WebSocketHandler) + server = pywsgi.WSGIServer(('0.0.0.0', opt.listenport), app, handler_class=WebSocketHandler) server.serve_forever() \ No newline at end of file