All WebSocket connections must be authenticated. The Web Server has a login as part of its functionality. The websockets use that login state since the WebSockets is part of the web server. If the login was handled separately we would see a double login. One login to load the
html and another to access the
So, if a websocket connection is initialized from a page that was fetched from the protected area in the web server and the user logged in, then the websocket
GET response will contain an
If an additional login is required then the websocket connection will return a
setCredentials(username, password) method. Calling this method and providing
undefined for either or both arguments with disable the use of the default login.
OnLoggedIn listener is where you should do any initial work that you want to get done when the connection is established. For example, if you want to read some registry keys when the page loads, you will do it when the
JnrWebsocket gets authenticated. The reads would fail if you tried to perform them before the connection has authenticated.