Skip to content

Commit b4455a3

Browse files
Update packages
1 parent 9795f7b commit b4455a3

4 files changed

Lines changed: 4 additions & 18 deletions

File tree

backend/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ Flask==2.0.1
1010
Flask-Cors==3.0.10
1111
Flask-RESTful==0.3.9
1212
Flask-SocketIO==5.3.6
13-
gevent==24.2.1
14-
greenlet==3.0.3
13+
eventlet==0.36.1
1514
idna==2.10
1615
itsdangerous==2.0.1
1716
Jinja2==3.0.1

backend/services/socket.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88

99
sio = 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

2119
usersInRoom = {}

nginx.conf

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff 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

services.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
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 &
72
nginx -g 'daemon off;'

0 commit comments

Comments
 (0)