diff --git a/Tesses.WebServer.EasyServer/Class1.cs b/Tesses.WebServer.EasyServer/Class1.cs index ac71804..ac2cc48 100644 --- a/Tesses.WebServer.EasyServer/Class1.cs +++ b/Tesses.WebServer.EasyServer/Class1.cs @@ -49,7 +49,17 @@ public static class EasyServerExtensions foreach(var item in iface.GetIPProperties().UnicastAddresses) { if(item.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork){ - ips.Add($"{url.scheme}://{item.Address.ToString()}:{url.port}/"); + if(BitConverter.IsLittleEndian) + { + ips.Add($"{url.scheme}://{item.Address.ToString()}:{url.port}/"); + + } + else + { + var addrBytes = item.Address.GetAddressBytes(); + ips.Add($"{url.scheme}://{addrBytes[3]}.{addrBytes[2]}.{addrBytes[1]}.{addrBytes[0]}:{url.port}/"); + + } } } Console.WriteLine(string.Join(" , ",ips)); @@ -60,4 +70,4 @@ public static class EasyServerExtensions } } } -} \ No newline at end of file +} diff --git a/Tesses.WebServer.EasyServer/Tesses.WebServer.EasyServer.csproj b/Tesses.WebServer.EasyServer/Tesses.WebServer.EasyServer.csproj index f51faab..5accf3e 100644 --- a/Tesses.WebServer.EasyServer/Tesses.WebServer.EasyServer.csproj +++ b/Tesses.WebServer.EasyServer/Tesses.WebServer.EasyServer.csproj @@ -5,9 +5,9 @@ Tesses.WebServer.EasyServer Mike Nolan Tesses - 1.0.0 - 1.0.0 - 1.0.0 + 1.0.1 + 1.0.1 + 1.0.1 An easier way to setup server for Tesses.WebServer MIT HTTP, WebServer, Website