Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty and Http 1.1 upgrade header


On Mon, Sep 24, 2012 at 10:58 PM, Bergmann Manfred <manfred@xxxxxxxxxxx> wrote:
> Hi there.
> We use Jetty 8.1.5 in our current development.
> Does anyone know whether Jetty supports the Http 1.1 upgrade header to upgrade from an unencrypted connection to an encrypted connection?
> See

It is not supported directly, but the mechanisms to make it work are
there, since are those used by WebSocket.

The upgrade to SSL never got much traction due to the fact that port
443 is allocated for https, so almost everybody implements the
"upgrade" with a redirect to 443.
Feels awkward to have encrypted HTTP on port 80, but I digress.

Look at WebSocketServlet.service() that calls
WebSocketFactory.acceptWebSocket() that calls
WebSocketFactory.upgrade() and the magic is at the last line, where
you set a special request attribute that tells Jetty to switch the
connection: request.setAttribute("",

We may have something more formal in Jetty 9.

Developer advice, services and support
from the Jetty & CometD experts.
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz

Back to the top