diff options
| author | cannorin <13620400+cannorin@users.noreply.github.com> | 2025-01-14 21:20:24 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-14 12:20:24 +0000 |
| commit | 319f7e6a862d1ec943329f8d6bfaaf04f77337ba (patch) | |
| tree | 94c52dc4fdea7a980df9704f087e9d0d14fa82d0 /packages/misskey-js/src/streaming.ts | |
| parent | ノートのリンクをリモートのサーバーのURLとしてもコピ... (diff) | |
| download | misskey-319f7e6a862d1ec943329f8d6bfaaf04f77337ba.tar.gz misskey-319f7e6a862d1ec943329f8d6bfaaf04f77337ba.tar.bz2 misskey-319f7e6a862d1ec943329f8d6bfaaf04f77337ba.zip | |
feat(misskey-js): allow setting binaryType of WebSocket connection (#15190)
Co-authored-by: cannorin <cannorin@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/misskey-js/src/streaming.ts')
| -rw-r--r-- | packages/misskey-js/src/streaming.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/misskey-js/src/streaming.ts b/packages/misskey-js/src/streaming.ts index fec6114cca..0ef2d1e7a1 100644 --- a/packages/misskey-js/src/streaming.ts +++ b/packages/misskey-js/src/streaming.ts @@ -54,6 +54,7 @@ export default class Stream extends EventEmitter<StreamEvents> implements IStrea constructor(origin: string, user: { token: string; } | null, options?: { WebSocket?: Options['WebSocket']; + binaryType?: ReconnectingWebSocket['binaryType']; }) { super(); @@ -86,6 +87,9 @@ export default class Stream extends EventEmitter<StreamEvents> implements IStrea minReconnectionDelay: 1, // https://github.com/pladaria/reconnecting-websocket/issues/91 WebSocket: options.WebSocket, }); + if (options.binaryType) { + this.stream.binaryType = options.binaryType; + } this.stream.addEventListener('open', this.onOpen); this.stream.addEventListener('close', this.onClose); this.stream.addEventListener('message', this.onMessage); |