Skip to content

Lightweight C# ASP.NET MVC and Web API IP address filtering library

License

Notifications You must be signed in to change notification settings

trygvelo/IP-Address-Filtering

 
 

Repository files navigation

Build status

IP-Address-Filtering

Lightweight C# ASP.NET MVC and Web API IP address filtering library

The library allows validating IP address against:

  • Single IP address
  • List of multiple IP addresses
  • Single IP address range
  • Multiple IP address ranges

How to use

    public class DataController : ApiController
    {
        [HttpGet]
        [Route("api/data/{recordId}")]
        [IPAddressFilter("94.201.50.212", IPAddressFilteringAction.Restrict)]
        public HttpResponseMessage GetData(int recordId)
        {
            /* Create response logic here */
            return this.Request.CreateResponse<object>(HttpStatusCode.OK, new object());
        }
    }

Bitdeli Badge

About

Lightweight C# ASP.NET MVC and Web API IP address filtering library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%