fix(websocket): configure Socket.IO path for nginx proxy

This commit is contained in:
hailin 2026-01-10 01:12:58 -08:00
parent ab9f479f81
commit d073bd5a9d
2 changed files with 2 additions and 0 deletions

View File

@ -21,6 +21,7 @@ interface SendMessagePayload {
credentials: true, credentials: true,
}, },
namespace: '/ws/conversation', namespace: '/ws/conversation',
path: '/ws/conversation/socket.io',
}) })
export class ConversationGateway export class ConversationGateway
implements OnGatewayConnection, OnGatewayDisconnect implements OnGatewayConnection, OnGatewayDisconnect

View File

@ -21,6 +21,7 @@ export function useChat() {
if (!userId) return; if (!userId) return;
const socket = io('/ws/conversation', { const socket = io('/ws/conversation', {
path: '/ws/conversation/socket.io',
query: { userId }, query: { userId },
transports: ['websocket'], transports: ['websocket'],
}); });