Skip to content

Cloudflare's Requester IP Address its a Laravel Package to retrieve the real requester IP Address behind the Cloudflare's Reverse Proxy

License

Notifications You must be signed in to change notification settings

henriqueramos/cloudflare_ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare's Requester IP Address

Cloudflare's Requester IP Address its a Laravel Package to retrieve the real requester IP Address behind the Cloudflare's Reverse Proxy.

Dependencies

As part of my personal effort to everyone migrate to Laravel 5.8 this package has this Laravel version as a minimum required version per default.

Installation

Install this package in your project through Composer. After that, let the Laravel auto package discovery handle everything else to allow the properly usage.

Steps

  1. Add this repository as one of your dependencies with
composer config repositories.henriqueramos_cloudflare_ip vcs https://github.com/henriqueramos/cloudflare_ip:master
  1. Run the command composer install to retrieve the latest version of the code from Github.

Usage

After installing it, the package will add a new middleware called cloudflare_ip into your route groups web and api.

If you want to use it in other places rather than web/api groups you can call it directly from middleware statement.

I.e:

Route::put('post/{id}', function ($id) {
    //
})->middleware('cloudflare_ip');

Contributing

Pull requests are extremely welcome. For major changes, please open an issue to discuss what you would like to change.

Also please, make sure to test your code properly.

Credits

This package was based on the efforts of molayli/laravel-cloudflare-real-ip and sumanion/laravel-cloudflare

License

Copyright 2019 Henrique Ramos

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Cloudflare's Requester IP Address its a Laravel Package to retrieve the real requester IP Address behind the Cloudflare's Reverse Proxy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published