This plugin parses a PROXY protoocol v2 Type-Length-Value (TLV) vector into a readable representation. This class is intended to be used to parse the connect hooks $arguments["proxytlv"] property.
Follow the instructions in our manual to add our package repository and then run the below command.
apt-get install halon-extras-proxytlv
yum install halon-extras-proxytlv
These classes needs to be imported from the extras://proxytlv module path.
Parse the Type-Length-Value (TLV) string.
Params
- proxytlv
string- The TLV string
Returns: class object.
On Error
An Exception is thrown
Return the value of a type. For known type, the type argument should on in the list.
| Type | Return | |
|---|---|---|
| ALPN | string |
|
| AUTHORITY | string |
|
| CRC32C | number |
|
| UNIQUE_ID | string |
|
| SSL | array of string |
VERSION, CN, CIPHER, SIG_ALG, KEY_ALG |
| NETNS | string |
|
number |
string |
Returns: the requested type if available
Return type: any, none on error
This example will extract the AWS VPC endpoint service id from the Network Load Balancer.
$data = ProxyTLV($argument["proxytlv"]);
if (($awsType = $data->value(0xEA)) and // PP2_TYPE_AWS
($awsTypeUnpack = unpack("ca*", $awsType)) and
($awsTypeUnpack[0] == 0x01)) // PP2_SUBTYPE_AWS_VPCE_ID
{
echo $awsTypeUnpack[1];
}
Return all available types.
Returns: list of types
Return type: array