mightypenguin/noVNC — comment on commit f3861500e43b44bad22ccc3c2e4df89fae500cc7
File: include/rfb.js line 222
By kanaka:

You should allow view_only option to be changed after the RFB object is constructed.

In other words, you probably want to create a setter for view_only (see set_local_cursor) that adds or drops the mouse and keyboard handlers when the option is set (and then call it in the constructor to initialize it).