Http Forwarded header parsing

52 views
Skip to first unread message

Michel Barret

unread,
Aug 9, 2018, 5:47:17 AM8/9/18
to vert.x
Hello,

I need to know whats is my domain inside verticle through a reverse proxy. The frequently used headers are X-Forwarded-Host and X-Forwarded-Proto, but this headers aren't standards…
IETF choose "Forwarded" as header to make it with sophisticated rules of parsing. Vertx have any helper to parse it ?

If no I thinks that I will create it. Like BodyHandler I think create an handler to parse header and put a MultiMap in RoutingContext.
vertx-web could interested by this contribution ?

Have a nice day

Paulo Lopes

unread,
Aug 9, 2018, 8:57:43 AM8/9/18
to vert.x
What is the format of the header?

Michel Barret

unread,
Aug 9, 2018, 12:12:16 PM8/9/18
to vert.x
Oops I forgoten it's define in RFC 7239.

Examples given by rfc :
       Forwarded: for="_gazonk"
       Forwarded: For="[2001:db8:cafe::17]:4711"
       Forwarded: for=192.0.2.60;proto=http;by=203.0.113.43
       Forwarded: for=192.0.2.43, for=198.51.100.17

Paulo Lopes

unread,
Aug 9, 2018, 3:59:34 PM8/9/18
to vert.x
I think this could be in the routing context as a lazy parsed read only property.
Reply all
Reply to author
Forward
0 new messages