diff --git a/Caddyfile b/Caddyfile index 09b2b84..e3721d6 100644 --- a/Caddyfile +++ b/Caddyfile @@ -16,6 +16,11 @@ http://promptplace.kro.kr { Referrer-Policy "strict-origin-when-cross-origin" } + # Socket.IO 요청을 백엔드로 전달 + handle /socket.io/* { + reverse_proxy app:3000 + } + # api-docs 요청을 앱으로 전달 handle /api-docs* { reverse_proxy app:3000 @@ -59,6 +64,11 @@ http://promptplace-dev.kro.kr { Referrer-Policy "strict-origin-when-cross-origin" } + # Socket.IO 요청을 백엔드로 전달 + handle /socket.io/* { + reverse_proxy app-dev:3000 + } + handle /api/* { # app-dev 컨테이너(테스트용)로 연결 reverse_proxy app-dev:3000 { diff --git a/src/socket/server.ts b/src/socket/server.ts index 9894e56..edd9d45 100644 --- a/src/socket/server.ts +++ b/src/socket/server.ts @@ -83,6 +83,7 @@ export const initSocket = (httpServer: HttpServer) => { "https://promptplace-develop.vercel.app", ], methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], + allowedHeaders: ["Authorization", "Content-Type"], credentials: true } });