Updated to be host and protocol agnostic

pull/488/head
Jm Casler 2020-10-17 12:00:21 -07:00
rodzic 63113d57b3
commit 7f12af73d4
1 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -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"