This commit is contained in:
Christopher Cookman 2024-09-04 07:42:20 -06:00
parent 80475c62f2
commit 8fb06c39b1
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42
2 changed files with 8 additions and 3 deletions

2
README.md Normal file
View file

@ -0,0 +1,2 @@
# Websocket Client for Roblox
TODO: Detailed instructions on how to use this module will be added soon.

View file

@ -1,6 +1,7 @@
local Base64 = require(script.Base64)
local JobId = game:GetService('HttpService'):GenerateGUID(false)
local BaseUrl = "https://sock.kcadev.org/api/"
print("jobid is " .. JobId)
local BaseUrl = "https://sock.kcadev.org"
local atob = Base64.atob
local btoa = Base64.btoa
local messages = {}
@ -26,12 +27,14 @@ local ws = function (dict)
["Url"] = BaseUrl .. "/connect/" .. JobId,
["Method"] = "PUT",
["Body"] = dict.url
})
}).Body
print(id)
print(typeof(id))
local function sendMessage(msg)
wait()
server:PostAsync(BaseUrl .. "api/send/" .. JobId .."/"..id, msg)
end
local function close()
server:RequestAsync({
["Url"] = BaseUrl .. "api/close/" .. JobId .. "/" .. id,