echo icon indicating copy to clipboard operation
echo copied to clipboard

azure front door x-forwaded-for

Open pankajmyt opened this issue 5 months ago • 4 comments

our api runs behind frontdoor .

https://echo.labstack.com/docs/ip-address

this picks right most. however azure frontdoor is inverse of it.

can you provide an option to pick from left/right depending on config.

pankajmyt avatar Jul 22 '25 10:07 pankajmyt

My 2 cents:

Would be better if u provide a sample, to have a case. For example I didn't have experience with Azure platforms so I don't know how frontdoor works.

Regards

FrancoTampieri avatar Jul 22 '25 11:07 FrancoTampieri

So echo ip address picks right most ip. whereas azure, does clientip, proxy1 ip, internal container app env. so if I use the xff extractor it gives proxy2 ip.

where as if you see https://expressjs.com/en/guide/behind-proxies.html

this picks left most ip, so works

pankajmyt avatar Jul 22 '25 13:07 pankajmyt

you could create custom IPExtrator https://github.com/labstack/echo/blob/98ca08e7dd64075b858e758d6693bf9799340756/ip.go#L213 and set to echo.IPExtractor https://github.com/labstack/echo/blob/98ca08e7dd64075b858e758d6693bf9799340756/echo.go#L99

aldas avatar Jul 23 '25 17:07 aldas

I have, but if xff extractor could support trusting from left/right. that will be great.

pankajmyt avatar Jul 24 '25 05:07 pankajmyt