modified: main.js
This commit is contained in:
4
main.js
4
main.js
@@ -27,8 +27,6 @@ Server can respond with single button updates: {"Method": "UPDATE_BUTTON","Butto
|
|||||||
- Server can "UPDATE_BUTTON" in any moment
|
- Server can "UPDATE_BUTTON" in any moment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var clients = {}
|
|
||||||
|
|
||||||
function generateQR(ServerName, ServerIP, token, ServerPort = 8191) {
|
function generateQR(ServerName, ServerIP, token, ServerPort = 8191) {
|
||||||
const qrcode = require('qrcode-terminal');
|
const qrcode = require('qrcode-terminal');
|
||||||
// it generates the exact same link as the official one, but it does not work (?)
|
// 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') {
|
function broadcastServer(ServerName, ServerIP, BroadcastPort = 8191, BroadcastAddress = '255.255.255.255') {
|
||||||
const dgram = require('dgram');
|
const dgram = require('dgram');
|
||||||
const udpClient = dgram.createSocket('udp4');
|
const udpClient = dgram.createSocket('udp4');
|
||||||
@@ -72,7 +71,6 @@ function broadcastServer(ServerName, ServerIP, BroadcastPort = 8191, BroadcastAd
|
|||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function startWsServer(ServerPort = 8191) {
|
function startWsServer(ServerPort = 8191) {
|
||||||
const { WebSocketServer } = require("ws");
|
const { WebSocketServer } = require("ws");
|
||||||
const wss = new WebSocketServer({ port: ServerPort })
|
const wss = new WebSocketServer({ port: ServerPort })
|
||||||
|
|||||||
Reference in New Issue
Block a user