From ed72d40adf5f34ee92319865bf3f355af33709a8 Mon Sep 17 00:00:00 2001 From: bel Date: Wed, 30 Jul 2014 21:25:33 +0200 Subject: [PATCH] Websocket test should support WSS --- test/websocket.lua | 2 +- test/websocket.xhtml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/websocket.lua b/test/websocket.lua index 45ea1eae..7338ed87 100644 --- a/test/websocket.lua +++ b/test/websocket.lua @@ -2,7 +2,7 @@ timerID = "timeout" --timerID = "interval" function trace(text) - local f = io.open("R:\\websocket.trace", "a") + local f = io.open("websocket.trace", "a") f:write(os.date() .. " - " .. text .. "\n") f:close() end diff --git a/test/websocket.xhtml b/test/websocket.xhtml index 5bb236ea..87b9753c 100644 --- a/test/websocket.xhtml +++ b/test/websocket.xhtml @@ -29,7 +29,8 @@ } function load() { - connection = new WebSocket("ws://" + window.location.host + "/websocket.lua"); + var wsproto = (location.protocol === 'https:') ? "wss:" : "ws:"; + connection = new WebSocket(wsproto + "//" + window.location.host + "/websocket.lua"); websock_text_field = document.getElementById('websock_text_field'); hand_min = document.getElementById('hand_min'); hand_hour = document.getElementById('hand_hour');