PHPackages                             ge-tracker/laravel-vapor-trusted-proxies - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ge-tracker/laravel-vapor-trusted-proxies

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ge-tracker/laravel-vapor-trusted-proxies
========================================

Build a dynamic list of trusted proxies for use with Laravel Vapor

v2.2.0(2y ago)844.3k2[1 PRs](https://github.com/ge-tracker/laravel-vapor-trusted-proxies/pulls)MITPHPPHP ^8.0

Since Jun 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ge-tracker/laravel-vapor-trusted-proxies)[ Packagist](https://packagist.org/packages/ge-tracker/laravel-vapor-trusted-proxies)[ Docs](https://github.com/ge-tracker/laravel-vapor-trusted-proxies)[ RSS](/packages/ge-tracker-laravel-vapor-trusted-proxies/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (8)Used By (0)

Laravel Vapor Trusted Proxies
=============================

[](#laravel-vapor-trusted-proxies)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c9c6b4dc5e30b31c32c70fa6bec7cb49e2a900cf3ba907ca5c2e3ec3da8eb30d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67652d747261636b65722f6c61726176656c2d7661706f722d747275737465642d70726f786965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ge-tracker/laravel-vapor-trusted-proxies)[![Total Downloads](https://camo.githubusercontent.com/263a497614ddddec9e7019ecad1900ab8a9eb0ea79b12f45c63da92b53c861d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67652d747261636b65722f6c61726176656c2d7661706f722d747275737465642d70726f786965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ge-tracker/laravel-vapor-trusted-proxies)

This package was created due to `request()->ip()` always returning `127.0.0.1` on [Laravel Vapor](https://vapor.laravel.com/). There are [several fixes](https://stackoverflow.com/questions/58346824/how-can-i-get-the-ip-of-an-http-request-in-a-laravel-vapor-application/) online that [trust all proxy servers](https://github.com/fideloper/TrustedProxy/issues/107#issuecomment-373065215). These solutions may be suitable for basic applications, however, these changes will allow any user to send the `X-FORWARDED-FOR` header to spoof their originating IP address.

Due to the dynamic nature of Laravel Vapor, it becomes a challenge to set the [trusted proxies](https://laravel.com/docs/7.x/requests#configuring-trusted-proxies) for your Laravel application. If you rely on the IP address of the user being valid, then this package is for you!

Version Compatibility
---------------------

[](#version-compatibility)

[Laravel 9.0](https://laravel.com/docs/9.x/upgrade) introduced changes to the default `TrustedProxies` middleware, and the [fideloper/proxy](https://packagist.org/packages/fideloper/proxy) package is no longer required, as the [functionality is included with Laravel](https://github.com/illuminate/http/blob/9.x/Middleware/TrustProxies.php). I'm not actively using Vapor and am not sure whether this package is still required, but I have gone ahead and updated the requirements and pushed the `v2.0` release, which drops support for earlier Laravel versions.

LaravelPackage Version`^9.0` and up`^2.0``
