resources/plezi_websockets.html in plezi-0.10.8 vs resources/plezi_websockets.html in plezi-0.10.9

- old
+ new

@@ -12,10 +12,10 @@ input, #output {font-size: 1em; width: 60%; margin: 0.5em 19%; padding: 0.5em 1%;} #output {height: 60%; overflow: auto; background-color: #fff;} </style> <script> var websocket = NaN; - function connect() { websocket = new WebSocket('ws://' + window.location.hostname + (window.location.port == '' ? '' : (':' + window.location.port) ) + "/" ); } + function connect() { websocket = new WebSocket( (window.location.protocol.match(/https/) ? 'wws' : 'ws') + '://' + window.location.hostname + (window.location.port == '' ? '' : (':' + window.location.port) ) + "/" ); } function init() { connect() websocket.onopen = function(evt) { WriteMessage("Connected.", "connection") }; websocket.onclose = function(evt) { WriteMessage("Disconnected.", "connection");connect(); };