TSHttpTxnVerifiedAddrSet

Sets a client IP address verified by a plugin.

Synopsis

#include <ts/ts.h>
TSReturnCode TSHttpTxnVerifiedAddrSet(TSHttpTxn txnp, const struct sockaddr *addr)

Description

This function enables plugins to provide a reliable client IP address for Traffic Server and other plugins. This is useful if there is a proxy in front of Traffic Server and it forwards client's IP address by HTTP header field, PROXY protocol, etc. Plugins that call this function are expected to check the validity of the IP address.

The provided address will be used if proxy.config.acl.subjects is set to PLUGIN. Plugins can get the provided address by calling the getter function below if those need client's real IP address.

The address addr is internally copied and Traffic Server core maintains its own copy. Plugins that call this function do not need to keep the original for later use.

TSHttpTxnVerifiedAddrGet

Gets the client IP address verified by a plugin.

Synopsis

#include <ts/ts.h>
TSReturnCode TSHttpTxnVerifiedAddrGet(TSHttpTxn txnp, const struct sockaddr **addr)

Description

This is the getter version of the above setter. This returns 1 if a verified address is available. Please note that a port number is not always available even if the function returns 1.

The address returned is maintained by Traffic Server core. Plugins cannot free the memory.