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 classProxyPeerAddressHandler.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 voidhandleRequest(HttpServerExchange exchange)Handle the request.StringtoString()
-
-
-
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:HttpHandlerHandle the request.- Specified by:
handleRequestin interfaceHttpHandler- Parameters:
exchange- the HTTP request/response exchange- Throws:
Exception
-
-