modified: main.js

This commit is contained in:
2025-02-02 20:29:29 -03:00
parent 1d12ee900e
commit ad0154c5b0

View File

@@ -27,8 +27,6 @@ Server can respond with single button updates: {"Method": "UPDATE_BUTTON","Butto
- Server can "UPDATE_BUTTON" in any moment
*/
var clients = {}
function generateQR(ServerName, ServerIP, token, ServerPort = 8191) {
const qrcode = require('qrcode-terminal');
// it generates the exact same link as the official one, but it does not work (?)
@@ -46,6 +44,7 @@ function generateQR(ServerName, ServerIP, token, ServerPort = 8191) {
});
}
var clients = {}
function broadcastServer(ServerName, ServerIP, BroadcastPort = 8191, BroadcastAddress = '255.255.255.255') {
const dgram = require('dgram');
const udpClient = dgram.createSocket('udp4');
@@ -72,7 +71,6 @@ function broadcastServer(ServerName, ServerIP, BroadcastPort = 8191, BroadcastAd
}, 5000);
}
function startWsServer(ServerPort = 8191) {
const { WebSocketServer } = require("ws");
const wss = new WebSocketServer({ port: ServerPort })