Telegram Web K with changes to work inside I2P
https://web.telegram.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
/* |
|
* https://github.com/morethanwords/tweb |
|
* Copyright (C) 2019-2021 Eduard Kuzmenko |
|
* https://github.com/morethanwords/tweb/blob/master/LICENSE |
|
* |
|
* Originally from: |
|
* https://github.com/zhukov/webogram |
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com> |
|
* https://github.com/zhukov/webogram/blob/master/LICENSE |
|
*/ |
|
|
|
import type {TransportType} from '../lib/mtproto/dcConfigurator'; |
|
|
|
const Modes = { |
|
test: location.search.indexOf('test=1') > 0/* || true */, |
|
debug: location.search.indexOf('debug=1') > 0, |
|
http: false, |
|
ssl: true, // location.search.indexOf('ssl=1') > 0 || location.protocol === 'https:' && location.search.indexOf('ssl=0') === -1, |
|
multipleConnections: true, |
|
asServiceWorker: false, |
|
transport: 'websocket' as TransportType, |
|
noSharedWorker: location.search.indexOf('noSharedWorker=1') > 0 |
|
}; |
|
|
|
// #if MTPROTO_HAS_HTTP |
|
Modes.http = location.search.indexOf('http=1') > 0; |
|
// #endif |
|
|
|
// #if MTPROTO_HTTP || !MTPROTO_HAS_WS |
|
Modes.http = true; |
|
// #endif |
|
|
|
if(Modes.http) { |
|
Modes.transport = 'https'; |
|
} |
|
|
|
// #if MTPROTO_SW |
|
Modes.asServiceWorker = true; |
|
// #endif |
|
|
|
export default Modes;
|
|
|