change Javascript config property serverUrl to use wss protocol and secure port, e.g.
var config = {
serverUrl: "wss://localhost:8443/websocket",
OnOpen: function (event) { },
OnClose: function (event) { }
};
If you are using not trusted certificate, remember to also update your webapp to use secure connection (otherwise user wont be able to accept not trusted connection in browser)