|
|
@ -105,8 +105,8 @@ export function initIpcMain(win, store) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ipcMain.on('setProxy', (event, config) => {
|
|
|
|
ipcMain.on('setProxy', (event, config) => {
|
|
|
|
console.log(config);
|
|
|
|
|
|
|
|
const proxyRules = `${config.protocol}://${config.server}:${config.port}`;
|
|
|
|
const proxyRules = `${config.protocol}://${config.server}:${config.port}`;
|
|
|
|
|
|
|
|
store.set('proxy', proxyRules);
|
|
|
|
win.webContents.session.setProxy(
|
|
|
|
win.webContents.session.setProxy(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
proxyRules,
|
|
|
|
proxyRules,
|
|
|
@ -120,5 +120,6 @@ export function initIpcMain(win, store) {
|
|
|
|
ipcMain.on('removeProxy', (event, arg) => {
|
|
|
|
ipcMain.on('removeProxy', (event, arg) => {
|
|
|
|
console.log('removeProxy');
|
|
|
|
console.log('removeProxy');
|
|
|
|
win.webContents.session.setProxy({});
|
|
|
|
win.webContents.session.setProxy({});
|
|
|
|
|
|
|
|
store.set('proxy', '');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|