|
@@ -0,0 +1,28 @@
|
|
|
+# Lua Websocket for Quik
|
|
|
+
|
|
|
+### Базовая инициализация
|
|
|
+```
|
|
|
+local WebSocketClient = require('websocket')
|
|
|
+local copas = require "copas"
|
|
|
+
|
|
|
+local client = WebSocketClient.new({
|
|
|
+ uri = "http://localhost:3000",
|
|
|
+})
|
|
|
+
|
|
|
+copas.loop()
|
|
|
+```
|
|
|
+
|
|
|
+### Config init
|
|
|
+```
|
|
|
+on_connected -> callback of connected init
|
|
|
+on_disconnected -> callback of disconnected
|
|
|
+on_received(data) -> callback of recevied messages from ws server
|
|
|
+```
|
|
|
+
|
|
|
+### Send Websocket Message To Server
|
|
|
+```
|
|
|
+function WebSocketClient:send(command, data)
|
|
|
+
|
|
|
+command -> string,
|
|
|
+data -> any
|
|
|
+```
|