Use wss:// when we're connected over https://.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3198 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2016-04-11 00:12:19 +00:00
parent 2c8bea27a0
commit 6fbd00bddf

View File

@ -423,7 +423,8 @@ $(document).ready(function() {
window.addEventListener("message", onMessage, false); window.addEventListener("message", onMessage, false);
enableDragDrop(); enableDragDrop();
gSocket = new WebSocket("ws://" gSocket = new WebSocket(
(window.location.protocol == "https:" ? "wss://" : "ws://")
+ window.location.hostname + window.location.hostname
+ (window.location.port.length ? ":" + window.location.port : "") + (window.location.port.length ? ":" + window.location.port : "")
+ "/terminal/socket"); + "/terminal/socket");