mirror of
https://github.com/riperiperi/FreeSO
synced 2026-08-13 20:26:13 -04:00
MPL per-file was used in older project files, but should apply to the whole project, so having it there was redundant.
21 lines
509 B
C#
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();
|
|
}
|
|
}
|
|
}
|