1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop: Resolves #164: Add support for proxy (#6537)

This commit is contained in:
Jason Williams
2022-07-10 14:54:31 +01:00
committed by GitHub
parent 2c4cf9fbdb
commit 8bb5b4a557
7 changed files with 108 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
import Setting, { Env } from './models/Setting';
import Logger, { TargetType, LoggerWrapper } from './Logger';
import shim from './shim';
const { setupProxySettings } = require('./shim-init-node');
import BaseService from './services/BaseService';
import reducer, { setStore } from './reducer';
import KeychainServiceDriver from './services/keychain/KeychainServiceDriver.node';
@@ -456,6 +457,14 @@ export default class BaseApplication {
syswidecas.addCAs(f);
}
},
'net.proxyEnabled': async () => {
setupProxySettings({
maxConcurrentConnections: Setting.value('sync.maxConcurrentConnections'),
proxyTimeout: Setting.value('net.proxyTimeout'),
proxyEnabled: Setting.value('net.proxyEnabled'),
proxyUrl: Setting.value('net.proxyUrl'),
});
},
// Note: this used to run when "encryption.enabled" was changed, but
// now we run it anytime any property of the sync target info is
@@ -491,6 +500,9 @@ export default class BaseApplication {
sideEffects['locale'] = sideEffects['dateFormat'];
sideEffects['encryption.passwordCache'] = sideEffects['syncInfoCache'];
sideEffects['encryption.masterPassword'] = sideEffects['syncInfoCache'];
sideEffects['sync.maxConcurrentConnections'] = sideEffects['net.proxyEnabled'];
sideEffects['sync.proxyTimeout'] = sideEffects['net.proxyEnabled'];
sideEffects['sync.proxyUrl'] = sideEffects['net.proxyEnabled'];
if (action) {
const effect = sideEffects[action.key];