Fix using WebSockets on Safari
This commit is contained in:
parent
c803a39db9
commit
ae9e6a7682
@ -25,7 +25,7 @@ import { IS_WEB_WORKER } from '../../helpers/context';
|
|||||||
import { DcId } from '../../types';
|
import { DcId } from '../../types';
|
||||||
import { getEnvironment } from '../../environment/utils';
|
import { getEnvironment } from '../../environment/utils';
|
||||||
|
|
||||||
/// #if !MTPROTO_SW
|
/// #if !MTPROTO_SW && SAFARI_PROXY_WEBSOCKET
|
||||||
import SocketProxied from './transports/socketProxied';
|
import SocketProxied from './transports/socketProxied';
|
||||||
/// #endif
|
/// #endif
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ export class DcConfigurator {
|
|||||||
const retryTimeout = connectionType === 'client' ? 10000 : 10000;
|
const retryTimeout = connectionType === 'client' ? 10000 : 10000;
|
||||||
|
|
||||||
let oooohLetMeLive: MTConnectionConstructable;
|
let oooohLetMeLive: MTConnectionConstructable;
|
||||||
/// #if MTPROTO_SW
|
/// #if MTPROTO_SW || !SAFARI_PROXY_WEBSOCKET
|
||||||
oooohLetMeLive = Socket;
|
oooohLetMeLive = Socket;
|
||||||
/// #else
|
/// #else
|
||||||
oooohLetMeLive = (getEnvironment().IS_SAFARI && IS_WEB_WORKER && typeof(SocketProxied) !== 'undefined') /* || true */ ? SocketProxied : Socket;
|
oooohLetMeLive = (getEnvironment().IS_SAFARI && IS_WEB_WORKER && typeof(SocketProxied) !== 'undefined') /* || true */ ? SocketProxied : Socket;
|
||||||
|
@ -31,6 +31,7 @@ const opts = {
|
|||||||
MTPROTO_AUTO: MTPROTO_AUTO, // use HTTPS when WS is unavailable
|
MTPROTO_AUTO: MTPROTO_AUTO, // use HTTPS when WS is unavailable
|
||||||
MTPROTO_HAS_HTTP: MTPROTO_AUTO || MTPROTO_HTTP,
|
MTPROTO_HAS_HTTP: MTPROTO_AUTO || MTPROTO_HTTP,
|
||||||
MTPROTO_HAS_WS: MTPROTO_AUTO || !MTPROTO_HTTP,
|
MTPROTO_HAS_WS: MTPROTO_AUTO || !MTPROTO_HTTP,
|
||||||
|
SAFARI_PROXY_WEBSOCKET: false,
|
||||||
DEBUG: devMode,
|
DEBUG: devMode,
|
||||||
|
|
||||||
version: 3,
|
version: 3,
|
||||||
|
Loading…
Reference in New Issue
Block a user