File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ Flask==2.0.1
1010Flask-Cors == 3.0.10
1111Flask-RESTful == 0.3.9
1212Flask-SocketIO == 5.3.6
13- gevent == 24.2.1
14- greenlet == 3.0.3
13+ eventlet == 0.36.1
1514idna == 2.10
1615itsdangerous == 2.0.1
1716Jinja2 == 3.0.1
Original file line number Diff line number Diff line change 88
99sio = SocketIO (
1010 cors_allowed_origins = "*" ,
11- async_mode = 'gevent ' ,
11+ async_mode = 'eventlet ' ,
1212 logger = False ,
1313 engineio_logger = False ,
1414 ping_timeout = 60 ,
1515 ping_interval = 25 ,
16- # Support both Socket.IO protocol v2 (old clients) and v4 (new clients)
1716 allow_upgrades = True ,
18- # This allows backward compatibility with socket_io_client 1.0.2 and forward compatibility with 3.x
1917)
2018
2119usersInRoom = {}
Original file line number Diff line number Diff line change @@ -12,20 +12,14 @@ server {
1212
1313 location /api/ {
1414 proxy_set_header Host $host ;
15- proxy_set_header X-Real-IP $remote_addr ;
16- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
17- proxy_pass http ://127.0.0.1:5000 /api/;
15+ proxy_pass http ://localhost:5000 /api/;
1816 }
1917
2018 location /socket.io/ {
2119 proxy_http_version 1.1;
2220 proxy_buffering off;
2321 proxy_set_header Upgrade $http_upgrade ;
2422 proxy_set_header Connection "upgrade" ;
25- proxy_set_header Host $host ;
26- proxy_set_header X-Real-IP $remote_addr ;
27- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
28- proxy_read_timeout 86400 ;
2923 proxy_pass http ://127.0.0.1:5000 /socket.io/;
3024 }
3125
Original file line number Diff line number Diff line change 1- #! /bin/bash
2- cd /usr/share/nginx/backend/
3-
4- # Run Flask-SocketIO directly with gevent (bypass uWSGI for WebSocket support)
5- python3 -m backend &
6-
1+ cd /usr/share/nginx/backend/ && uwsgi --http :5000 --http-websockets --master --wsgi-file __main__.py --callable app &
72nginx -g ' daemon off;'
You can’t perform that action at this time.
0 commit comments