Dag has been working implementing support for HAProxy’s PROXY protocol in Varnish. This is a protocol adds a small header on each incoming TCP connection that describes who the real client is, added by (for example) an SSL terminating process. (since srcip is the terminating proxy)
We’re aiming for merging this into Varnish master (so perhaps in 4.1?) when it is ready.
The code is still somewhat unfinished, timeouts are lacking and some polishing needed, but it works and can be played with in a development setup.
Code can be found here: https://github.com/daghf/varnish-cache/tree/PROXY
I think Dag is using haproxy to test it with. I’ve run it with stunnel (some connection:close issues to figure out still), and I’d love if someone could test it with ELB, stud or other PROXY implementations.