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,