Skip to main content

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

Also, for Jetty WebSocket API on EE10 take a look at this test class for inspiration.

https://github.com/jetty/jetty.project/blob/jetty-12.0.x/jetty-ee10/jetty-ee10-websocket/jetty-ee10-websocket-jetty-tests/src/test/java/org/eclipse/jetty/ee10/websocket/tests/ProgrammaticWebSocketUpgradeTest.java

Joakim Erdfelt / joakim@xxxxxxxxxxx


On Mon, Oct 16, 2023 at 10:01 AM Silvio Bierman via jetty-users <jetty-users@xxxxxxxxxxx> wrote:
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

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top