public class ProxyChain
extends java.lang.Object
X-Forwarded-For header.| Constructor and Description |
|---|
ProxyChain(IPAddress origin,
java.util.List<IPAddress> proxies)
Creates a new chain from a origin (the original client) and all intermediate proxies.
|
ProxyChain(java.util.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(java.lang.Object obj) |
static java.util.Optional<ProxyChain> |
fromForwardedForHeader(java.lang.String header)
Creates a Proxy chain from the
X-Forwarded-For HTTP header. |
(package private) static IPAddress |
getIPAddress(java.lang.String address) |
IPAddress |
getOrigin()
Get the origin of the request (the clients address).
|
java.util.List<IPAddress> |
getProxies()
Get a list of all intermediate proxy servers.
|
int |
hashCode() |
java.lang.String |
toString() |
public ProxyChain(IPAddress origin, java.util.List<IPAddress> proxies)
origin - the originproxies - the proxiespublic ProxyChain(java.util.List<IPAddress> chain)
X-Forwarded-For header. The list has to have
at least one member.chain - the chainpublic IPAddress getOrigin()
public java.util.List<IPAddress> getProxies()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static java.util.Optional<ProxyChain> fromForwardedForHeader(java.lang.String header)
X-Forwarded-For HTTP header.header - the X-Forwarded-For headerProxyChain if the header is present, non empty and well formed.static IPAddress getIPAddress(java.lang.String address)
Copyright © 2015–2018 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.