I have an application that uses the websocket server based on berth 8. Everything works fine, and when the user refreshes the page, closes the page or moves to another page, the connection closes, and on the server side, the onClose event is fired.
I just moved to berth 9, and everything works the same in firefox (the connection is closed during the upgrade), but not on chrome or opera. I even close browsers and the onClose event did not fire.
I know that jetty 9 only supports the latest version of the websockets protocol, and I want to know if the browser sends any message to the server when the user refreshes the page, for example, and how to handle it on the pier or do I need to handle this in javascript , as in this example: correctly close WebSocket (HTML5, Javascript) using window.onbeforeunload ?
I would prefer that I can handle all the work on the server side. Thanks
UPDATE If I close the client connection using ws.close (), everything works fine.
source share