From 8fb06c39b1b5a34c4618e88abe2abd4cdc69421f Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 4 Sep 2024 07:42:20 -0600 Subject: [PATCH] Do thing --- README.md | 2 ++ WebSocket.lua | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..cbab6c5 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Websocket Client for Roblox +TODO: Detailed instructions on how to use this module will be added soon. \ No newline at end of file diff --git a/WebSocket.lua b/WebSocket.lua index 5195a66..51e6f4d 100644 --- a/WebSocket.lua +++ b/WebSocket.lua @@ -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,