Package org.microproxy
Enum Class ProxyProtocolMode
- All Implemented Interfaces:
Serializable,Comparable<ProxyProtocolMode>,Constable
Whether client connections start with a PROXY protocol header (v1 or v2, as HAProxy defines
them), which names the client a load balancer in front of the proxy connected for. See
HttpProxyServerBootstrap.withAcceptProxyProtocol(ProxyProtocolMode).-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionNo PROXY header is read: the connection's first bytes are the client's.A connection may start with a PROXY header: one that starts with a v1 ("PROXY ") or v2 signature has it read, and any other is served as if PROXY protocol were off, its first bytes left as they came.Every connection must start with a PROXY header; one that does not is closed. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProxyProtocolModestatic ProxyProtocolModeReturns the enum constant of this class with the specified name.static ProxyProtocolMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
OFF
No PROXY header is read: the connection's first bytes are the client's. The default. -
REQUIRED
Every connection must start with a PROXY header; one that does not is closed. Use it when every client reaches the proxy through a load balancer that sends the header. -
OPTIONAL
A connection may start with a PROXY header: one that starts with a v1 ("PROXY ") or v2 signature has it read, and any other is served as if PROXY protocol were off, its first bytes left as they came. Any client that can reach the listener can then claim any source address by sending a header, so use it only where the clients that can connect directly are trusted, or withHttpProxyServerBootstrap.withProxyProtocolTrustedSources(java.lang.String...)naming the load balancers whose headers count.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
parse
The mode a configuration value names:off,requiredoroptional(any case), or a boolean as LittleProxy'sallow_proxy_protocolkey takes it (true,onor1forREQUIRED;false,off,0,noor nothing forOFF).- Parameters:
value- the configuration value- Returns:
- the mode it names
- Throws:
IllegalArgumentException- for any other value
-