-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Programmatic WebSocket upgrade in Jetty 10 #5866
Comments
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts please consider that this seems the same use case that is already implemented in CometD, so perhaps we don't need anything because it's already there? |
@sbordet I think CometD is still using the |
@lachlan-roberts the upgrade mechanism is a standard in Servlet APIs, so I'm not sure what exactly is that we can't already do? And if we really want to use a Jetty specific mechanism, |
@sbordet my request is for a programmatic way to perform a WebSocket upgrade at runtmie without having to register mappings. Those mappings are already maintained independently. |
@rstoyanchev did you try the standard Servlet 4.0 API for upgrade? Not good/enough for your case? |
The only thing I'm aware of is the |
@sbordet we don't support the standard upgrade mechanism. Plus it won't upgrade to our websocket implementation even if we did. |
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@rstoyanchev PR #5874 is ready if you want to take a look and give some feedback for your use case. This exposes some additional classes including JettyWebSocketServerContainer container = JettyWebSocketServerContainer.getContainer(getServletContext());
...
JettyWebSocketCreator creator = (req, resp) -> new EchoSocket();
container.upgrade(creator, request, response); |
@lachlan-roberts this looks good from an initial look. I will perform a more complete experiment next to confirm but as an API this is what I was looking for. |
I have now done a deeper experiment successfully. I still need to do some more testing on the async side but overall I can confirm the API is good for our needs. Note that I did run into other challenges due to types that have moved or changed, e.g. Thanks for these changes! |
@rstoyanchev lots of internals changes from Jetty 9 to Jetty 10 (and just as big from Jetty 10 to Jetty 11) |
I'm working on a Clojure websocket server based on jetty too. As in Jetty 9, it relies on As I checked demos of Jetty 10, the new APIs requires subclassing Being able to call |
…rammaticUpgrade Issue #5866 - allow WebSocket programmatic upgrades
Jetty version
10.0.x
Description
Issue brought up on the jetty-dev mailing list by @rstoyanchev.
The text was updated successfully, but these errors were encountered: