freeso/TSOClient/FSO.Server.Common/IPAddress.cs
riperiperi b57ebbd141 Cleanup: Remove most unused usings and MPL per-file licenses
MPL per-file was used in older project files, but should apply to the whole project, so having it there was redundant.
2023-11-25 03:45:29 +00:00

21 lines
509 B
C#

using System.Net;
namespace FSO.Server.Common
{
public class IPAddress
{
public static string Get(HttpListenerRequest httpRequest)
{
if (httpRequest.Headers["X-Forwarded-For"] != null)
{
return httpRequest.Headers["X-Forwarded-For"];
}
return Get(httpRequest.RemoteEndPoint);
}
public static string Get(IPEndPoint endpoint)
{
return endpoint.Address.ToString();
}
}
}