Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Configuring Jetty PROXY protocol support to fallback to regular HTTP

> On Mar 31, 2016, at 2:14 PM, Steven Schlansker <stevenschlansker@xxxxxxxxx> wrote:
> 
> Hello jetty-users,
> 
> I am investigating configuring the Proxy connector support as described in
> http://www.eclipse.org/jetty/documentation/current/configuring-connectors.html
> 
> One thing that I don't feel clear in the documentation is how you might configure
> Jetty to accept e.g. both HTTP and Proxy+HTTP connections on the same ServerConnector.
> 
> Looking at the code, in fact I'm not sure this is possible -- it seems that if you
> don't have a PROXY connection it just gives up:
> 
> // Check proxy
> if (!"PROXY".equals(_field[0]))
> {
>    LOG.warn("Not PROXY protocol for {}",getEndPoint());
>    close();
>    return;
> }

I've spent a couple of hours digging into this.

It looks like it is not possible today, or at least it's really not
obvious.  I'm seeing support for interfaces "UpgradeFrom" and "UpgradeTo"
used to hand off buffers from one type of Connection to the next
through an EndPoint.upgrade

Unfortunately, it seems that neither Proxy v1 nor v2 support UpgradeFrom,
HTTP only supports UpgradeFrom, and HTTPs neither -- when both would need UpgradeTo.

I'm considering contributing the following changes:

* 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 again,
Steven

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


Back to the top