fideloper/proxy
Laravel middleware for trusting reverse proxies and correctly handling forwarded headers (X-Forwarded-For/Proto/Host/Port). Ensures accurate client IP and HTTPS detection when running behind load balancers like ELB, Nginx, or Cloudflare.
As of Laravel 9, this package is in the core of Laravel and no longer needed. However some people use this package as a dependency in other cases. I've tagged this release for those people!
See here for more info: https://github.com/fideloper/TrustedProxy/issues/152
Allow installation in Laravel 9
See #135
This is likely not a breaking change for anyone.
Laravel 8 uses the newer Symfony 5, but it seems like they haven't changed Trusted Proxy support in this major release.
Support for Laravel 6 (already done), and support for Laravel 7 dev.
Laravel will be moving to semver, with a next release of version 6. This will allow TrustedProxy to be installed on version 6 of Laravel.
See pr #124
Updated the code for support for Symfony 4's latest incarnation of Trusted Proxies.
Now supporting auto-discovery of Trusted Proxy package for Laravel 5.5
PHP7 raised an warning when non-numeric values were used in bitwise operations (e.g. $foo | $bar where $foo or $bar was not a numeric value).
This resulted in a thrown ErrorException within Laravel.
This fixes that by returning out of the function before the bitwise calculation is complete, under the assumption that that condition only happens when Symfony < 3.3.
Merged in PRs #70 and #73 to be compatible with Symfony 3.3, which adds a secondary parameter to the $request->setTrustedProxies() method.
Resources to read more:
setTrustedProxies in Symfony 3.2 vs 3.3Note: This package should be backwards compatible with Symfony 3.2 and a Laravel install using Symfony 3.2. Let me know ASAP if that's not the case for you.
Merged #66 to fix issues with older versions of Laravel
Merged PR #52 to address possibility of multiple, chained proxies (e.g. a CDN and load balancer both in use). This correctly gets the end-user (client) IP address.
Thanks @GrahamCampbell and other contributors!
Note: Composer current sets the dependencies on Laravel ~5.0, let me know if you run into issue with this on newer Laravel.
Fixing #21, allowing multiple client IP addresses when using the * wildcard proxy IP address.
How can I help you explore Laravel packages today?