and_cesbo

Astra WebSocket client

Aug 20th, 2015
666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. http_request({
  2.     host = "127.0.0.1",
  3.     port = 8000,
  4.     path = "/control/event/",
  5.     headers = {
  6.         "Origin: http://127.0.0.1:8888",
  7.         "Upgrade: websocket",
  8.         "Connection: Upgrade",
  9.     },
  10.     callback = function(request, response)
  11.         if type(response) == "table" then
  12.             request:send(json.encode({scope = "auth"}))
  13.             return nil
  14.         end
  15.         table.dump(json.decode(response))
  16.     end
  17. })
Advertisement
Add Comment
Please, Sign In to add comment