Be able to access proxy client IP (including Lua)
authorJonathan Frank <jfrank@fb.com>
Fri, 13 Feb 2015 17:59:56 +0000 (09:59 -0800)
committerAlecs King <int@fb.com>
Tue, 3 Mar 2015 03:19:25 +0000 (19:19 -0800)
commit96242018c6e9355fb083983c2118ff27ea182eba
tree872cca00256db0367ce032bad5c5b3339331b54d
parentc7c65f54afa6e0927c1a9a5ee818a79de337151a
Be able to access proxy client IP (including Lua)

Summary:
Pass TransportInfo object through connection setup.  This allows us to
pass along additional info from the setup if necessary.

Test Plan:
Run proxygen on my devserver listening on ipv4 and ipv6 for ports 80 and 443.
Configure it to run a lua request rule with the following lines:

io.stderr:write("jonlog: proxy " .. conn:getClientAddrOriginal() .. "\n")
io.stderr:write("jonlog: client " .. request:getClientIPStr() .. "\n")

Run haproxy also on my devserver, listening on ports 8555-8558, with each
forwarding to one of the four pairs (ipv4-localhost/ipv6-localhost, 80/443)

From my laptop, run curls against each of these four endpoints and make
sure that we print out "127.0.0.1" as the proxy IP, and my laptop's IP
as the client IP.

Reviewed By: cgheorghe@fb.com

Subscribers: jsedgwick, yfeldblum, trunkagent, ruibalp, bmatheny, folly-diffs@, dsp, nbm

FB internal diff: D1746590

Tasks: 5688127

Signature: t1:1746590:1423695880:f647964d95636a69a00304e144aef71ee0213d28
folly/wangle/acceptor/Acceptor.cpp
folly/wangle/acceptor/Acceptor.h
folly/wangle/acceptor/TransportInfo.h