All handlers in that example work apart from the websockets handler
WebSocketHandler wsHandler = new WebSocketHandler() {
@Override
public void configure(WebSocketServletFactory factory) {
factory.register(WebsocketsService.class);
}
};
HandlerList handlers = new HandlerList();
handlers.setHandlers(new Handler[] { resource_handler, servletContextHandler, wsHandler, new DefaultHandler() });
server.setHandler(handlers);
it fails with
WebSocket connection to 'ws://localhost:8080/' failed: Error during WebSocket handshake: Unexpected response code: 200
how would be a websockets handler properly configured and added (maybe with a differen Path and Port as the servletContextHandler or could it be added there ?) ?