mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 21:17:34 +00:00
ws auth
This commit is contained in:
parent
fad6411850
commit
9582b41b56
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user