Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Allowing Jetty Proxy protocol support to fallback to regular HTTP

Hi jetty-dev,

I posted this yesterday to the user mailing list but realized afterwards that I probably should
have asked -dev, so apologize for the cross-re-post.


The original message is here: http://dev.eclipse.org/mhonarc/lists/jetty-users/msg06865.html
in a slightly more long-winded format.

It seems that today, when you add the ProxyConnectionFactory (to add support for HAProxy's Proxy
protocol support to a downstream e.g. HttpConnectionFactory) you commit to having *every* incoming
request have the Proxy connect line.

It would be nice to have the ProxyConnectionFactory detect whether a Proxy connection is
indeed coming in -- if it is, parse the metadata and handoff, otherwise just do the handoff
immediately and assume that a non-proxy request.

In our case, we have an AWS ELB configured to do TCP passthrough, and as such we lose our
client's IP.  We'd like to upgrade, but currently we can neither add Proxy to the ELB
first (since that would ruin our non-Proxy-aware Jetty setup) nor can we add Proxy
to Jetty, since that would ruin our existing non-Proxy ELB connections.

Having Jetty autodetect would save our bacon and significantly reduce rollout
complexity.

I've looked into implementing it, and it seems like the correct thing is to
go through the EndPoint.upgrade UpgradeFrom / UpgradeTo mechanism.

I think it would be relatively straightforward:

* Implement HttpConnection UpgradeTo
* Implement SslConnection UpgradeTo
* Implement ProxyProtocolV*Connection UpgradeFrom

Is this the right path to be going down?  Is this a valuable contribution?
Has anyone considered working on this, and maybe could do it much more quickly
than I can?

Thanks for your guidance,
Steven

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


Back to the top