I wrote a program for chatting using servlets and websockets implemented in javascript. The problem is that when page is refreshed or user is navigating to other pages websocket connection is terminated (and on next page load it reconnects).
Can I include external js file containing webscokets connection in each page, is it the proper way.