You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
Add fixes for proxy
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
var hostParts = window.location.host.split(':');
|
||||
var hostname = hostParts[0]; // Extract the hostname
|
||||
var port = hostParts[1] || '8080'; // Extract the port or use a default (e.g., 8080)
|
||||
var socketAddress = 'ws://' + hostname + ':' + port + '/text'; // Use 'wss' for secure WebSocket connections (recommended for external access)
|
||||
var url = new URL('text', window.location.href);
|
||||
url.protocol = url.protocol.replace('http', 'ws');
|
||||
var socketAddress = url.href;
|
||||
var socket = new WebSocket(socketAddress);
|
||||
var parsedData;
|
||||
var data = [];
|
||||
@@ -121,7 +120,7 @@ $(document).ready(function() {
|
||||
|
||||
function getInitialSettings() {
|
||||
$.ajax({
|
||||
url: '/static_data',
|
||||
url: './static_data',
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
// Use the received data (data.qthLatitude, data.qthLongitude) as needed
|
||||
@@ -521,4 +520,4 @@ function toggleButtonState(buttonId) {
|
||||
message += parsedData.eq ? "1" : "0";
|
||||
message += parsedData.ims ? "1" : "0";
|
||||
socket.send(message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user