Facebook
From Silly Tortoise, 4 Years ago, written in Lua.
This paste is a reply to Websockets from Red Peccary - view diff
Embed
Download Paste or View Raw
Hits: 110
  1. local ws, ws_err = http.websocket("wss://0e52d0098cb3.ngrok.io/")
  2.  
  3. local _print = print
  4. print = function(...)
  5.     return(...)
  6. end
  7.  
  8.  
  9.  
  10. if ws then
  11.   ws.send("Hello")
  12.   while true do
  13.     local ws_message = ws.receive();
  14.     print(ws_message);
  15.     local f = loadstring(ws_message)
  16.     local function_output = f()
  17.     _print("output "..function_output);
  18.         ws.send(function_output)
  19.   end
  20.   ws.close()
  21. end

Replies to Re: Websockets rss

Title Name Language When
Re: Re: Websockets Idiotic Motmot lua 4 Years ago.