This commit is contained in:
Linventif 2023-09-26 16:24:07 +02:00
parent fad6411850
commit 9582b41b56

View File

@ -2,12 +2,19 @@
// WebSocket
//
if (!GWSockets) then return gmInte.logError("GWSockets not found!") end
if (!gmInte.config.websocket) then return end
require("gwsockets")
if (GWSockets) then return gmInte.logError("GWSockets is not installed! Please install it from https://github.com/FredyH/GWSockets") end
local socket = GWSockets.createWebSocket("wss://ws.gmod-integration.com")
// Authentication
socket:setHeader("id", gmInte.config.id)
socket:setHeader("token", gmInte.config.token)
// Dev
function socket:onMessage(txt)
print("Received: ", txt)
end