public class ProxyChain extends Object
X-Forwarded-For header.| Constructor and Description |
|---|
ProxyChain(IPAddress origin,
List<IPAddress> proxies)
Creates a new chain from a origin (the original client) and all intermediate proxies.
|
ProxyChain(List<IPAddress> chain)
Creates a new chain from a list of addresses as found in the
X-Forwarded-For header. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static Optional<ProxyChain> |
fromForwardedForHeader(String header)
Creates a Proxy chain from the
X-Forwarded-For HTTP header. |
(package private) static IPAddress |
getIPAddress(String address) |
IPAddress |
getOrigin()
Get the origin of the request (the clients address).
|
List<IPAddress> |
getProxies()
Get a list of all intermediate proxy servers.
|
int |
hashCode() |
String |
toString() |
public ProxyChain(IPAddress origin, List<IPAddress> proxies)
origin - the originproxies - the proxiespublic IPAddress getOrigin()
public List<IPAddress> getProxies()
public static Optional<ProxyChain> fromForwardedForHeader(String header)
X-Forwarded-For HTTP header.header - the X-Forwarded-For headerProxyChain if the header is present, non empty and well formed.Copyright © 2015–2021 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.