Do thing
This commit is contained in:
parent
80475c62f2
commit
8fb06c39b1
2
README.md
Normal file
2
README.md
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Websocket Client for Roblox
|
||||||
|
TODO: Detailed instructions on how to use this module will be added soon.
|
|
@ -1,6 +1,7 @@
|
||||||
local Base64 = require(script.Base64)
|
local Base64 = require(script.Base64)
|
||||||
local JobId = game:GetService('HttpService'):GenerateGUID(false)
|
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 atob = Base64.atob
|
||||||
local btoa = Base64.btoa
|
local btoa = Base64.btoa
|
||||||
local messages = {}
|
local messages = {}
|
||||||
|
@ -26,12 +27,14 @@ local ws = function (dict)
|
||||||
["Url"] = BaseUrl .. "/connect/" .. JobId,
|
["Url"] = BaseUrl .. "/connect/" .. JobId,
|
||||||
["Method"] = "PUT",
|
["Method"] = "PUT",
|
||||||
["Body"] = dict.url
|
["Body"] = dict.url
|
||||||
})
|
}).Body
|
||||||
|
print(id)
|
||||||
|
print(typeof(id))
|
||||||
local function sendMessage(msg)
|
local function sendMessage(msg)
|
||||||
wait()
|
wait()
|
||||||
server:PostAsync(BaseUrl .. "api/send/" .. JobId .."/"..id, msg)
|
server:PostAsync(BaseUrl .. "api/send/" .. JobId .."/"..id, msg)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function close()
|
local function close()
|
||||||
server:RequestAsync({
|
server:RequestAsync({
|
||||||
["Url"] = BaseUrl .. "api/close/" .. JobId .. "/" .. id,
|
["Url"] = BaseUrl .. "api/close/" .. JobId .. "/" .. id,
|
||||||
|
|
Loading…
Reference in a new issue