How to set Set trusted proxies for Laravel

Laravel 5 has a much nicer system for Middleware, which this package now takes advantage of.

New features include:

  1. TrustedProxies are now set as in an HTTP Middleware, which makes more logical sense than the previous ServiceProvider. If you’re unsure what that means, remember to “Just Trust Fideloper™”.
  2. You can now set the trusted header names. This is useful for proxies that don’t use the usual X-Forwarded-* headers.

To use this with Laravel 5, run the following from your Laravel 5 project directory:

composer require fideloper/proxy:~3.0

Or of course, you can edit your composer.json file directly:

{
    "require": {
        "fideloper/proxy": "~3.0"
    }
}

About the author

Deven Rathore

I'm Deven Rathore, a multidisciplinary & self-taught designer with 3 years of experience. I'm passionate about technology, music, coffee, traveling and everything visually stimulating. Constantly learning and experiencing new things.

Get The best In Web dev

Get The best In Web dev

Join dunebook and recieve best in Angular, React, Vue, Python, Java & more. Directly to your inbox once a week FREE !

You have Successfully Subscribed!

Pin It on Pinterest