Monday, June 02, 2014

Latest Updates for Domino WebSocket

***websocket project has been broken out into its own project, on openntf*** 
As of release 1.0.9 for websocket:
-Modified the plugin to accept command line parameters:
Available Command Line Operations:
  • tell http osgi websocket stop (Run this prior to stopping http to avoid server crashes. This command will terminate the threads cleanly)
  • tell http osgi websocket start
  • tell http osgi websocket count (gets the current count of websockets on the current server)
  • tell http osgi websocket count-all (gets the count of all the websockets across a cluster)
  • tell http osgi websocket show-all-users (shows all users currently using a websocket across a cluster)
  • tell http osgi websocket show-users (shows users on current server)
-Added code in all runnables to listen for a stop signal.
-Added better DoS attack prevention via below notes.ini params:
  • WEBSOCKET_MAX_MSG_SIZE (instead of waiting for entire message, it attempts to capture size incrementally and terminate connections if max)
  • WEBSOCKET_MAX_CONNECTIONS (will terminate connections if max is reached)
-Refactored the broadcast logic to create less documents. Now it only creates one document per server in a cluster as opposed to one per user.
-Updated testing code to execute randomly sized messages (see in project)

-Overall this release should be the most stable.... unless I missed something :)

download available on openntf


Csaba Kiss said...

Mark, when I monitor my websocket server users, I have users named rhino.*
Where do they come form and why they are there?
I also noticed that if I look at the Users view in the websocket.nsf, it does not always track the users correctly. It leaves some users online even if they closed their browser window. And I see a couple of those rhino.fdb8... users, as well.n How do I get rid of them?

Mark Ambler said...

Hi Csaba,
Next release I'm currently working on is fixing a problem when a user transitions from Anonymous to Authenticated back to Anonymous. Also, prior to restarting http, be sure to execute the command line "tell http osgi websocket stop". There's a process that stamps all the documents with a status of OFFLINE. I think this next release should also fix your problem of users in an inconsistent state.

The Rhino user denotes that a SSJS script has been loaded and will execute based on a specific routing path / uri. To run it, set the to value in the chat.xsp to the target uri /chat.nsf/* and you should see the response from the SSJS design element. To disable you can comment out the code in chat.xsp in the beforePageLoad event, then stop websocket and restart http task.

I'm close to finishing up the next release, so please check back here, or openntf in a few days.