1 | import * as debug from 'debug';
|
2 | const d = debug('@electron/get:proxy');
|
3 |
|
4 |
|
5 |
|
6 | export function initializeProxy() {
|
7 | try {
|
8 |
|
9 | const MAJOR_NODEJS_VERSION = parseInt(process.version.slice(1).split('.')[0], 10);
|
10 | if (MAJOR_NODEJS_VERSION >= 10) {
|
11 |
|
12 | require('global-agent').bootstrap();
|
13 | }
|
14 | else {
|
15 |
|
16 | require('global-tunnel-ng').initialize();
|
17 | }
|
18 | }
|
19 | catch (e) {
|
20 | d('Could not load either proxy modules, built-in proxy support not available:', e);
|
21 | }
|
22 | }
|
23 |
|
\ | No newline at end of file |