mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-15 14:51:21 +00:00
22 lines
509 B
C#
22 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();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|