format and installer branches

This commit is contained in:
kepler155c@gmail.com
2018-01-24 17:39:38 -05:00
parent 1eea0d7cd8
commit 5a32fe208e
80 changed files with 10742 additions and 10156 deletions

View File

@@ -2,18 +2,18 @@ local Event = require('event')
local Socket = require('socket')
Event.addRoutine(function()
while true do
print('proxy: listening on port 188')
local socket = Socket.server(188)
while true do
print('proxy: listening on port 188')
local socket = Socket.server(188)
print('proxy: connection from ' .. socket.dhost)
print('proxy: connection from ' .. socket.dhost)
Event.addRoutine(function()
local api = socket:read(2)
if api then
Event.addRoutine(function()
local api = socket:read(2)
if api then
local proxy = _G[api]
local methods = { }
local methods = { }
for k,v in pairs(proxy) do
if type(v) == 'function' then
table.insert(methods, k)
@@ -21,14 +21,14 @@ Event.addRoutine(function()
end
socket:write(methods)
while true do
local data = socket:read()
if not data then
while true do
local data = socket:read()
if not data then
print('proxy: lost connection from ' .. socket.dhost)
break
end
socket:write({ proxy[data.fn](table.unpack(data.args)) })
end
break
end
socket:write({ proxy[data.fn](table.unpack(data.args)) })
end
end
end)
end