socket.lua

local ws,err = http.websocket("ws://c58a90595815.ngrok.io")

if ws then
    while true do
        write("WSS>> ")
        local command = read()
        if string.find( command, "@coin" ) then
            ws.send(command)
            local message,binary = ws.receive()
            local data = string.match(message, ",")
            print(data)
            print("Coin Data:")
            print("User: "..data[0].."/ Coins: "..data[1])
        end
    end
    
    ws.close()
end