Fix using WebSockets on Safari

This commit is contained in:
Eduard Kuzmenko 2022-07-01 17:17:16 +02:00
parent 1c8ff8b45f
commit 540cace79c
2 changed files with 3 additions and 2 deletions

View File

@ -25,7 +25,7 @@ import { IS_WEB_WORKER } from '../../helpers/context';
import { DcId } from '../../types';
import { getEnvironment } from '../../environment/utils';
/// #if !MTPROTO_SW
/// #if !MTPROTO_SW && SAFARI_PROXY_WEBSOCKET
import SocketProxied from './transports/socketProxied';
/// #endif
@ -72,7 +72,7 @@ export class DcConfigurator {
const retryTimeout = connectionType === 'client' ? 10000 : 10000;
let oooohLetMeLive: MTConnectionConstructable;
/// #if MTPROTO_SW
/// #if MTPROTO_SW || !SAFARI_PROXY_WEBSOCKET
oooohLetMeLive = Socket;
/// #else
oooohLetMeLive = (getEnvironment().IS_SAFARI && IS_WEB_WORKER && typeof(SocketProxied) !== 'undefined') /* || true */ ? SocketProxied : Socket;

View File

@ -31,6 +31,7 @@ const opts = {
MTPROTO_AUTO: MTPROTO_AUTO, // use HTTPS when WS is unavailable
MTPROTO_HAS_HTTP: MTPROTO_AUTO || MTPROTO_HTTP,
MTPROTO_HAS_WS: MTPROTO_AUTO || !MTPROTO_HTTP,
SAFARI_PROXY_WEBSOCKET: false,
DEBUG: devMode,
version: 3,