1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-11-25 19:38:07 +11:00

Compare commits

...

2 Commits

Author SHA1 Message Date
effcadc915 bugfix for getChannel 2019-12-20 02:19:35 +11:00
b938640625 improved vtunnel compatibility with real tunnel cards 2019-12-20 02:14:03 +11:00

View File

@ -72,6 +72,16 @@ local function createTunnel(host,port,addr,raddr)
proxy.last = computer.uptime()
end
end
function proxy.getWakeMessage()
return false
end
proxy.setWakeMessage = proxy.getWakeMessage
function proxy.maxPacketSize()
return 8192
end
function proxy.getChannel()
return host..":"..tostring(port)
end
event.listen("internet_ready",proxy.read)
listeners[addr] = {"internet_ready",proxy.read}
timers[addr] = event.timer(cfg.rtimer, proxy.read, math.huge)
@ -113,6 +123,11 @@ function settimer(time)
savecfg()
end
function listpeers()
for k,v in pairs(cfg.peers) do
print(string.format("#%d (%s:%d)\n Local address: %s\n Remote address: %s",k,v.host,v.port,v.addr,v.raddr))
end
end
function addpeer(host,port)
port = tonumber(port) or 4096
local t = {}
@ -124,12 +139,6 @@ function addpeer(host,port)
print(string.format("Added peer #%d (%s:%d) to the configuration.\nRestart to apply changes.",#cfg.peers,host,port))
savecfg()
end
function listpeers()
for k,v in pairs(cfg.peers) do
print(string.format("#%d (%s:%d)\n Local address: %s\n Remote address: %s",k,v.host,v.port,v.addr,v.raddr))
end
end
function delpeer(n)
n=tonumber(n)
if not n then