🐛 Set proxy
This commit is contained in:
parent
7b10f042b5
commit
b589a93f13
2 changed files with 7 additions and 4 deletions
|
@ -737,6 +737,13 @@ app.whenReady().then(() => {
|
|||
break;
|
||||
case "setProxy":
|
||||
event.sender.session.closeAllConnections().then(() => {
|
||||
if (data.proxyURL.startsWith("://")) {
|
||||
event.sender.session.setProxy({mode: "system"}).then(() => {
|
||||
console.log("network proxy [system]");
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
event.sender.session.setProxy({proxyRules: data.proxyURL}).then(() => {
|
||||
console.log("network proxy [" + data.proxyURL + "]");
|
||||
});
|
||||
|
|
|
@ -8,10 +8,6 @@ import {Constants} from "../../constants";
|
|||
|
||||
export const setProxy = () => {
|
||||
/// #if !BROWSER
|
||||
if ("" === window.siyuan.config.system.networkProxy.scheme) {
|
||||
console.log("network proxy [system]");
|
||||
return;
|
||||
}
|
||||
ipcRenderer.send(Constants.SIYUAN_CMD, {
|
||||
cmd: "setProxy",
|
||||
proxyURL: `${window.siyuan.config.system.networkProxy.scheme}://${window.siyuan.config.system.networkProxy.host}:${window.siyuan.config.system.networkProxy.port}`
|
||||
|
|
Loading…
Add table
Reference in a new issue