mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 07:06:28 +08:00
fix: use secure websocket (#5297)
This commit is contained in:
@@ -7,9 +7,16 @@ export function getIoManager(): Manager {
|
||||
if (ioManager) {
|
||||
return ioManager;
|
||||
}
|
||||
ioManager = new Manager('/', {
|
||||
autoConnect: false,
|
||||
transports: ['websocket'],
|
||||
});
|
||||
const { protocol, hostname, port } = window.location;
|
||||
ioManager = new Manager(
|
||||
`${protocol === 'https:' ? 'wss' : 'ws'}://${hostname}${
|
||||
port ? `:${port}` : ''
|
||||
}/`,
|
||||
{
|
||||
autoConnect: false,
|
||||
transports: ['websocket'],
|
||||
secure: location.protocol === 'https:',
|
||||
}
|
||||
);
|
||||
return ioManager;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user