https://github.com/kineticcafe/ip_access_control
Elixir Plug to control access by IP address
https://github.com/kineticcafe/ip_access_control
cidr elixir elixir-plug ip-restrictions
Last synced: 10 months ago
JSON representation
Elixir Plug to control access by IP address
- Host: GitHub
- URL: https://github.com/kineticcafe/ip_access_control
- Owner: KineticCafe
- License: other
- Created: 2021-01-05T05:28:11.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-22T03:05:24.000Z (about 1 year ago)
- Last Synced: 2025-07-07T13:37:06.092Z (11 months ago)
- Topics: cidr, elixir, elixir-plug, ip-restrictions
- Language: Elixir
- Homepage:
- Size: 63.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- Contributing: Contributing.md
Awesome Lists containing this project
README
# IP Access Control Plug
This plug restricts requests so that they must come from the range of IP
addresses specified in the pipeline configuration. This assumes that the IP is
present in the `remote_ip` attribute on the passed-in `Plug.Conn`.
If the request IP is not allowed, the specified response code and body will be
added to the Plug.Conn and the chain will be halted. Otherwise, the plug chain
will continue.
Documentation can be found at .
## Installation
Add `ip_access_control` to your dependencies. If your application is running
behind a proxy, you should to also include and use [`remote_ip`] as an explicit
dependency and configure that as well.
```elixir
def deps do
[
{:ip_access_control, "~> 1.0.1"},
{:remote_ip, "~> 1.0"} # Required if behind a proxy
]
end
```
[build status svg]: https://travis-ci.org/KineticCafe/bamboo_elastic_email.svg?branch=master
[build status]: https://travis-ci.org/KineticCafe/bamboo_elastic_email
[contributing.md]: Contributing.md
[open source projects]: https://github.com/KineticCafe
[kccoc]: https://github.com/KineticCafe/code-of-conduct
[hexdocs]: https://hexdocs.pm/ip_access_control
[`remote_ip`]: https://hexdocs.pm/remote_ip/api-reference.html