电子桌面应用程序,可以打开使用代理IP地址的url

我刚刚发现关于电子js。 我想创build桌面应用程序,可以帮助打开代理服务器的网站 。 我已经尝试了下面的代码,请帮助我。请评论任何工作的例子。

const electron = require('electron'); const app = electron.app; var BrowserWindow = require('browser-window'); electron.crashReporter.start(); var mainWindow = null; app.on('window-all-closed', function() { if (process.platform != 'darwin') { app.quit(); } }); app.on('ready', function() { // without proxy simple //var win = new BrowserWindow({ width: 800, height: 600, show: false }); //win.on('closed', function() { // win = null; //}); // //win.loadURL('https://www.panduboys.com'); //win.show(); var win = new BrowserWindow({ width: 800, height: 600 }); win.loadUrl("http://www.panduboys.com"); var session = win.webContents.session session.setProxy("http=190.98.162.22:8080", function() { console.log('done proxy kind of things'); }); }); 

Interesting Posts