Configuration.connectProxyProtocol()
Description
Appends a connectProxyProtocol filter to the current pipeline layout.
A connectProxyProtocol filter implements the Proxy Protocol on the client side.
- INPUT - Data stream to send to the server via the Proxy Protocol.
- OUTPUT - Data stream received from the server.
- SUB-INPUT - Data stream to send to the server with the Proxy Protocol header added.
- SUB-OUTPUT - Data stream received from the server.
A connectProxyProtocol filter adds the Proxy Protocol header to its input Data stream and then pumps it into a newly created sub-pipeline. Its output is the same output from the sub-pipeline.
Syntax
pipy().pipeline().connectProxyProtocol(header).to(subPipelineLayout)pipy().pipeline().connectProxyProtocol(() => makeProxyProtocolHeader()).to(subPipelineLayout)
Parameters
connectProxyProtocol(header)
header
The Proxy Protocol header, or a function that returns it. The header should include the following fields:
- version - Can be 1 (default) or 2
- command - Can be "PROXY" (default) or "LOCAL"
- protocol - One of "TCP4" (default), "TCP6", "UDP4", "UDP6", "UNIX", "UNIX_DGRAM" and "UNKNOWN"
- sourceAddress - Source IP address
- sourcePort - Source port
- targetAddress - Destination IP address
- targetPort - Destination port
Return Value
The same Configuration object.