From ba9240c08657f3c88edb8896668a6fecbaa96aad Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Thu, 20 Apr 2017 19:03:06 +1000 Subject: [PATCH] added remote terminal applications --- modules/applications/evproxy-client.lua | 17 +++++++++++++++++ modules/applications/evproxy-srv.lua | 22 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 modules/applications/evproxy-client.lua create mode 100644 modules/applications/evproxy-srv.lua diff --git a/modules/applications/evproxy-client.lua b/modules/applications/evproxy-client.lua new file mode 100644 index 0000000..6e84a5d --- /dev/null +++ b/modules/applications/evproxy-client.lua @@ -0,0 +1,17 @@ +function nshc(evPP,nid) + while true do + if ev[1] == "net_msg" then + local V=false + local msg = tostring(ev[4]) + if ev[3] == evPP and ev[2] == nid then + if msg:sub(1,3) == "dis" then + h("display",msg:sub(4)) + end + end + elseif ev[1] == "key_down" then + ns(nid,evPP,"key"..tostring(ev[3])) + end + C.yield() + end +end + diff --git a/modules/applications/evproxy-srv.lua b/modules/applications/evproxy-srv.lua new file mode 100644 index 0000000..f967d7c --- /dev/null +++ b/modules/applications/evproxy-srv.lua @@ -0,0 +1,22 @@ +evPP,tEPs=4,{} +s("netsh daemon",function() + print("netsh daemon started") + while true do + if ev[1] == "net_msg" then + local V=false + local msg = tostring(ev[4]) + for k,v in ipairs(tEPs) do if ev[2] == v then V=true end end + if ev[3] == evPP and V then + if msg:sub(1,3) == "key" then + h("key_down",ev[2],tonumber(msg:sub(4)),0) + end + end + elseif ev[1] == "display" then + for k,v in ipairs(tEPs) do + ns(v,evPP,"dis"..tostring(ev[2])) + end + end + C.yield() + end +end) +