feat(core): enable socket cors (#12823)

fix android & ios selfhost syncing

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved WebSocket connection compatibility by enabling cross-origin
requests with credentials and restricting allowed HTTP methods to GET
and POST.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: fengmk2 <fengmk2@gmail.com>
This commit is contained in:
EYHN
2025-06-17 10:40:08 +09:00
committed by GitHub
parent 2366c1aba6
commit c1691157f9

View File

@@ -20,6 +20,12 @@ export class SocketIoAdapter extends IoAdapter {
const server: Server = super.createIOServer(port, {
...config,
...options,
// Enable CORS for Socket.IO
cors: {
origin: true, // Allow all origins
credentials: true, // Allow credentials (cookies, auth headers)
methods: ['GET', 'POST'],
},
});
if (config.canActivate) {