|
|
@@ -21,6 +21,7 @@ namespace Shadowsocks.Model |
|
|
|
public bool enabled;
|
|
|
|
public bool shareOverLan;
|
|
|
|
public bool isDefault;
|
|
|
|
public bool isIPv6Enabled = false;
|
|
|
|
public int localPort;
|
|
|
|
public bool portableMode = true;
|
|
|
|
public string pacUrl;
|
|
|
@@ -36,6 +37,10 @@ namespace Shadowsocks.Model |
|
|
|
|
|
|
|
private static string CONFIG_FILE = "gui-config.json";
|
|
|
|
|
|
|
|
public string LocalHost => GetLocalHost();
|
|
|
|
private string GetLocalHost() {
|
|
|
|
return isIPv6Enabled ? "[::1]" : "127.0.0.1";
|
|
|
|
}
|
|
|
|
public Server GetCurrentServer()
|
|
|
|
{
|
|
|
|
if (index >= 0 && index < configs.Count)
|
|
|
@@ -74,6 +79,10 @@ namespace Shadowsocks.Model |
|
|
|
config.proxy = new ProxyConfig();
|
|
|
|
if (config.hotkey == null)
|
|
|
|
config.hotkey = new HotkeyConfig();
|
|
|
|
if (!System.Net.Sockets.Socket.OSSupportsIPv6) {
|
|
|
|
config.isIPv6Enabled = false; // disable IPv6 if os not support
|
|
|
|
}
|
|
|
|
//TODO if remote host(server) do not support IPv6 (or DNS resolve AAAA TYPE record) disable IPv6?
|
|
|
|
|
|
|
|
config.proxy.CheckConfig();
|
|
|
|
|
|
|
|