Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Handle websocket upgrade request from inside Servlet#service (Jetty 12)

Hallo all,

I am porting an existing embedded Jetty application from Jetty11 to Jetty12. Since 12.0.2 everything seems to be working perfectly except for one thing I have not yet been able to port: our applications usage of the Jetty WebSocket API.

The Jetty12 WebSocket API documentation shows the upgrade being done inside the Handler#handle method using the org.eclipse.jetty.server.Request / org.eclipse.jetty.server.Response objects available there. However, in our application code the information required to create the endpoint object is only known inside the Servlet instance. In the Jetty11 API we where able to upgrade the request from inside the Servlet#service method because the JettyWebSocketServerContainer#upgrade took HttpServletRequest/HttpServletResponse parameters. In the Jetty12 WebSocket API ServerWebSocketContainer#upgrade these have been replaced by above mentioned Request/Response objects.

Is there a way around this?

Kind regards,

Silvio



Back to the top