17.03.2018, 10:03
How can I create custom package for LM?
I need custom websocket connections with TV and other stuff and I want to use this connection inside LUA resident or event scripts.
The main idea is I create a package which works as HTTP server on some local port and it has and ability to create websocket clients inside.
e.g.
event script
resident script 0 sec
Could you please create kind of this stuff? Or give me instruction how to build own package, I know C/C++, Golang, JS, Lua
Thank you in advance!
I need custom websocket connections with TV and other stuff and I want to use this connection inside LUA resident or event scripts.
The main idea is I create a package which works as HTTP server on some local port and it has and ability to create websocket clients inside.
e.g.
event script
Code:
ws = require('lua.websocket')
tvConnection, err = ws.connect('ws://my.tv.ip:3000') -- (blocking with t/o) send to local HTTP server
-- a command to connect if no connection
tvConnection.send('raw data') -- send text or array of bytes to 'ws://my.tv.ip:3000'
resident script 0 sec
Code:
ws = require('lua.websocket')
tvConnection, err = ws.connect('ws://my.tv.ip:3000') -- (blocking with t/o) send to local HTTP server
-- a command to connect if no connection
data = tvConnection.receive() -- receive array of data came from 'ws://my.tv.ip:3000'
Could you please create kind of this stuff? Or give me instruction how to build own package, I know C/C++, Golang, JS, Lua
Thank you in advance!