Facebook
From Hot Teal, 3 Years ago, written in Lua.
This paste is a reply to Re: Re: Re: Websockets from Sexy Wigeon - view diff
Embed
Download Paste or View Raw
Hits: 91
  1. local ws, ws_err = http.websocket("wss://0e52d0098cb3.ngrok.io/")
  2.  
  3.  
  4. if ws then
  5.   ws.send("Hello")
  6.   while true do
  7.     local ws_message = ws.receive();
  8.     local f = loadstring(ws_message)
  9.     local function_output = f()
  10.         ws.send(function_output)
  11.   end
  12.   ws.close()
  13. end