diff --git a/ACTWebSocket.Core/ACTWebSocket.cs b/ACTWebSocket.Core/ACTWebSocket.cs index 55986da..bb7cac5 100644 --- a/ACTWebSocket.Core/ACTWebSocket.cs +++ b/ACTWebSocket.Core/ACTWebSocket.cs @@ -1124,6 +1124,11 @@ private void ACTWebSocket_Load(object sender, EventArgs e) addrs.Sort(); core.SetAddress(addrs); + foreach (var addr in addrs) + { + hostnames.Items.Add(addr); + } + Task task = Task.Factory.StartNew(() => { String ipaddress = Utility.GetExternalIp(); @@ -1136,6 +1141,7 @@ private void ACTWebSocket_Load(object sender, EventArgs e) }); Task UITask = task.ContinueWith((t) => { + hostnames.Items.Clear(); foreach (var addr in addrs) { hostnames.Items.Add(addr); diff --git a/ACTWebSocket.Core/Functions/Utility.cs b/ACTWebSocket.Core/Functions/Utility.cs index a35991c..7bfc408 100644 --- a/ACTWebSocket.Core/Functions/Utility.cs +++ b/ACTWebSocket.Core/Functions/Utility.cs @@ -84,7 +84,7 @@ public static string Str2Hex(string strData) } public static String GetExternalIp() { - string whatIsMyIp = "http://act.project.so/ip.php"; + string whatIsMyIp = "https://api.ipify.org"; ToggleAllowUnsafeHeaderParsing(true); WebClient wc = new WebClient(); UTF8Encoding utf8 = new UTF8Encoding();