From 7f12af73d41967189c0dc0f7a7a6cffb663386f0 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Sat, 17 Oct 2020 12:00:21 -0700 Subject: [PATCH] Updated to be host and protocol agnostic --- src/meshwifi/meshhttp.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/meshwifi/meshhttp.cpp b/src/meshwifi/meshhttp.cpp index 897f81953..d6ab4edce 100644 --- a/src/meshwifi/meshhttp.cpp +++ b/src/meshwifi/meshhttp.cpp @@ -1142,8 +1142,15 @@ void handleBasicJS(HTTPRequest *req, HTTPResponse *res) "\n" " // Create new connection\n" " var httpconn = new meshtasticjs.IHTTPConnection();\n" - " let sslActive = false;\n" - " let deviceIp = '10.10.30.198'; // Your devices IP here\n" + "\n" + " // Set connection params\n" + " let sslActive;\n" + " if (window.location.protocol === 'https:') {\n" + " sslActive = true;\n" + " } else {\n" + " sslActive = false;\n" + " }\n" + " let deviceIp = window.location.hostname; // Your devices IP here\n" " \n" "\n" " // Add event listeners that get called when a new packet is received / state of device changes\n"