diff --git a/packages/provider/src/HocuspocusProviderWebsocket.ts b/packages/provider/src/HocuspocusProviderWebsocket.ts index b0a957b7..1b8482a7 100644 --- a/packages/provider/src/HocuspocusProviderWebsocket.ts +++ b/packages/provider/src/HocuspocusProviderWebsocket.ts @@ -4,8 +4,7 @@ import { import { retry } from '@lifeomic/attempt' import * as time from 'lib0/time' import * as url from 'lib0/url' -import type { MessageEvent } from 'ws' -import { Event } from 'ws' +import { type MessageEvent, Event } from 'ws' import EventEmitter from './EventEmitter.js' import { HocuspocusProvider } from './HocuspocusProvider.js' import { @@ -349,7 +348,7 @@ export class HocuspocusProviderWebsocket extends EventEmitter { this.identifier += 1 // Init the WebSocket connection - const ws = new this.configuration.WebSocketPolyfill(this.url) + const ws = new this.configuration.WebSocketPolyfill(this.url, { followRedirects: true }) ws.binaryType = 'arraybuffer' ws.identifier = this.identifier