Correctly shutting down a websocket handler
by Robin Anil
When a client disconnects, I see that onClose is not being fired. The only
way this seems to be firing if client sents a close frame.
Is there any way to detect disconnection and immediately close all the
opened resources.
Robin
Robin Anil | Software Engineer
1 year, 2 months
Creating a websocket proxy with undertow
by Marc Boorshtein
Using the 1.4 series, I'm trying to handle upgrade and websockets. Looking
at a few examples and the code I think what I need to do is:
1. add the WebSocketServlet to the right path
2. implement WebSocketConnectionCallback that will call my remote ws://
server
Am I on the right track? I haven't found an example of doing this with
undertow but found something similar with jetty (
https://github.com/chipster/chipster-web-server/blob/master/src/main/java...)
but I havne't found the same thing for undertow so any pointers would be
appreciated.
Thanks
Marc Boorshtein
5 years, 11 months
Forwarding initial websocket request
by Lukas Lentner
I am trying to forward the initial websocket http request coming in via a Servlet filter with the forward method (I want to cut off the first path segment):
final String requestUri = HttpServletRequest.class.cast(servletRequest).getRequestURI();
final String newRequestUri = requestUri.substring(requestUri.indexOf("/", 1));
servletRequest.getRequestDispatcher(newRequestUri).forward(servletRequest, servletResponse);
The filter is triggered successfully, but the websocket is not initialized instead 404 is returned.
Is this correct according to spec? How can I forward such requests?
Thankx
Lukas
6 years