When trust is specified as a function, it will be called for each
address to determine if it is a trusted address. The function is
given two arguments: addr and i, where addr is a string of
the address to check and i is a number that represents the distance
from the socket address.

Compiles argument val into a trust function. This function takes
the same arguments as trust does in proxyaddr(req, trust) and
returns a function suitable for proxyaddr(req, trust).

var trust = proxyaddr.compile('localhost')

var addr = proxyaddr(req, trust)

This function is meant to be optimized for use against every request.
It is recommend to compile a trust function up-front for the trusted
configuration and pass that to proxyaddr(req, trust) for each request.