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