Package io.undertow.server.handlers
Class ProxyPeerAddressHandler
- java.lang.Object
-
- io.undertow.server.handlers.ProxyPeerAddressHandler
-
- All Implemented Interfaces:
HttpHandler
public class ProxyPeerAddressHandler extends Object implements HttpHandler
Handler that sets the peer address to the value of the X-Forwarded-For header.This should only be used behind a proxy that always sets this header, otherwise it is possible for an attacker to forge their peer address;
- Author:
- Stuart Douglas
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProxyPeerAddressHandler.Builder
-
Constructor Summary
Constructors Constructor Description ProxyPeerAddressHandler(HttpHandler next)
ProxyPeerAddressHandler(HttpHandler next, boolean isChangeLocalAddrPort)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleRequest(HttpServerExchange exchange)
Handle the request.String
toString()
-
-
-
Constructor Detail
-
ProxyPeerAddressHandler
public ProxyPeerAddressHandler(HttpHandler next)
-
ProxyPeerAddressHandler
public ProxyPeerAddressHandler(HttpHandler next, boolean isChangeLocalAddrPort)
-
-
Method Detail
-
handleRequest
public void handleRequest(HttpServerExchange exchange) throws Exception
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
Exception
-
-