HAProxy and Cowboy

In order to have HAProxy tell you the actual IP address request came from https://code.google.com/p/haproxy-docs/wiki/forwardfor

And to see Cowboy source code