mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-26 10:20:51 +01:00
Add ignored hosts for proxy
This commit is contained in:
parent
dd0aeeb1db
commit
4681b916eb
@ -12,6 +12,11 @@ import java.io.IOException;
|
||||
|
||||
public class NitroWindows implements NitroOsFunctions {
|
||||
|
||||
/**
|
||||
* Semicolon separated hosts to ignore for proxying.
|
||||
*/
|
||||
private static final String PROXY_IGNORE = "discord.com;github.com;";
|
||||
|
||||
/**
|
||||
* Checks if the certificate is trusted by the local machine.
|
||||
* @param certificate Absolute path to the certificate.
|
||||
@ -59,6 +64,7 @@ public class NitroWindows implements NitroOsFunctions {
|
||||
try {
|
||||
final String proxy = String.format("%s:%d", host, port);
|
||||
Runtime.getRuntime().exec("reg add \"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" /v ProxyServer /t REG_SZ /d \"" + proxy + "\" /f");
|
||||
Runtime.getRuntime().exec("reg add \"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" /v ProxyOverride /t REG_SZ /d \"" + PROXY_IGNORE + "\" /f");
|
||||
Runtime.getRuntime().exec("reg add \"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\" /v ProxyEnable /t REG_DWORD /d 1 /f");
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
|
Loading…
Reference in New Issue
Block a user