简体   繁体   中英

How do I get system wide proxy settings and apply the same for my electron app?

I'm designing a page which is similar to the one in the link :

https://support.skype.com/en/faq/FA1017/can-i-connect-to-skype-through-a-proxy-server

How do I programatically set system-wide proxy in my app, how to configure those manually when user want to opt manual. I'm new to JS as well as Electron, so please redirect for proper solution if I'm not asking a right question here.

You can set a proxy config via command line, when starting the Electron App: ElectronApp.exe --proxy-server=127.0.0.1:1234 ( documentation ). This is not programmatically, but maybe this helps circumventing coding your own solution.

There is no built in way to do this with Electron and it will vary by OS. You're going to have to write custom code for each OS.

You'll need to lookup how to do this from code or command line for each platform and implement it yourself. For example here are some suggestions of how to do this using the registry on Windows.

Due to the possibility of abuse you'll likely required admin permissions on any system to make this change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM