option to use node's http client for sync without proxy

This commit is contained in:
zadam 2019-07-22 22:46:06 +02:00
parent b0c0c5f56b
commit ea0835561c
2 changed files with 6 additions and 1 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "trilium",
"version": "0.33.7",
"version": "0.34.0-beta",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -98,6 +98,11 @@ function getClient(opts) {
return require('electron').net;
}
else {
// hack for cases where electron.net does not work but we don't want to set proxy
if (opts.proxy === 'noproxy') {
opts.proxy = null;
}
// in case there's explicit proxy then we need to use protocol of the proxy since we're actually
// connecting to the proxy server and not to the end-target server
const {protocol} = url.parse(opts.proxy || opts.url);