diff options
Diffstat (limited to 'src/features/serviceProxy')
-rw-r--r-- | src/features/serviceProxy/index.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/features/serviceProxy/index.ts b/src/features/serviceProxy/index.ts index bdc21e97e..b3705b190 100644 --- a/src/features/serviceProxy/index.ts +++ b/src/features/serviceProxy/index.ts | |||
@@ -1,7 +1,8 @@ | |||
1 | import { autorun, observable } from 'mobx'; | 1 | import { autorun, observable } from 'mobx'; |
2 | import { session } from '@electron/remote'; | 2 | import { session } from '@electron/remote'; |
3 | 3 | ||
4 | const debug = require('debug')('Ferdium:feature:serviceProxy'); | 4 | // TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed |
5 | // const debug = require('debug')('Ferdium:feature:serviceProxy'); | ||
5 | 6 | ||
6 | export const config = observable({ | 7 | export const config = observable({ |
7 | isEnabled: true, | 8 | isEnabled: true, |
@@ -11,7 +12,7 @@ export default function init(stores: { | |||
11 | services: { enabled: any }; | 12 | services: { enabled: any }; |
12 | settings: { proxy: any }; | 13 | settings: { proxy: any }; |
13 | }) { | 14 | }) { |
14 | debug('Initializing `serviceProxy` feature'); | 15 | console.log('Initializing `serviceProxy` feature'); |
15 | 16 | ||
16 | autorun(() => { | 17 | autorun(() => { |
17 | config.isEnabled = true; | 18 | config.isEnabled = true; |
@@ -19,7 +20,7 @@ export default function init(stores: { | |||
19 | const services = stores.services.enabled; | 20 | const services = stores.services.enabled; |
20 | const proxySettings = stores.settings.proxy; | 21 | const proxySettings = stores.settings.proxy; |
21 | 22 | ||
22 | debug('Service Proxy autorun'); | 23 | console.log('Service Proxy autorun'); |
23 | 24 | ||
24 | for (const service of services) { | 25 | for (const service of services) { |
25 | const s = session.fromPartition(`persist:service-${service.id}`); | 26 | const s = session.fromPartition(`persist:service-${service.id}`); |
@@ -35,14 +36,14 @@ export default function init(stores: { | |||
35 | const proxyHost = `${serviceProxyConfig.host}${ | 36 | const proxyHost = `${serviceProxyConfig.host}${ |
36 | serviceProxyConfig.port ? `:${serviceProxyConfig.port}` : '' | 37 | serviceProxyConfig.port ? `:${serviceProxyConfig.port}` : '' |
37 | }`; | 38 | }`; |
38 | debug( | 39 | console.log( |
39 | `Setting proxy config from service settings for "${service.name}" (${service.id}) to`, | 40 | `Setting proxy config from service settings for "${service.name}" (${service.id}) to`, |
40 | proxyHost, | 41 | proxyHost, |
41 | ); | 42 | ); |
42 | 43 | ||
43 | s.setProxy({ proxyRules: proxyHost }) | 44 | s.setProxy({ proxyRules: proxyHost }) |
44 | .then(() => { | 45 | .then(() => { |
45 | debug( | 46 | console.log( |
46 | `Using proxy "${proxyHost}" for "${service.name}" (${service.id})`, | 47 | `Using proxy "${proxyHost}" for "${service.name}" (${service.id})`, |
47 | ); | 48 | ); |
48 | }) | 49 | }) |