Attempt #5 to fix CORS issue and docker build.

This commit is contained in:
Karmaa
2025-02-22 01:12:45 -06:00
parent a9d510aba4
commit 226cdcb7a0
2 changed files with 14 additions and 13 deletions

View File

@@ -20,19 +20,19 @@ http {
} }
# Proxy IO requests # Proxy IO requests
location /socket.io/ { #location /socket.io/ {
proxy_pass http://0.0.0.0:8081; # proxy_pass http://0.0.0.0:8081;
proxy_http_version 1.1; # proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; # proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade'; # proxy_set_header Connection 'upgrade';
proxy_set_header Host $host; # proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade; # proxy_cache_bypass $http_upgrade;
# CORS settings # # CORS settings
add_header 'Access-Control-Allow-Origin' '*'; # add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' '*'; # add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Headers' '*'; # add_header 'Access-Control-Allow-Headers' '*';
} #}
# Error pages # Error pages
error_page 500 502 503 504 /50x.html; error_page 500 502 503 504 /50x.html;

View File

@@ -8,7 +8,8 @@ const io = socketIo(server, {
origin: "*", // Allow all origins origin: "*", // Allow all origins
methods: ["*"], // Allow all methods methods: ["*"], // Allow all methods
allowedHeaders: ["*"], // Allow all headers allowedHeaders: ["*"], // Allow all headers
} },
allowEIO3: true
}); });
io.on("connection", (socket) => { io.on("connection", (socket) => {