1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-11-23 02:28:05 +11:00

improved vtunnel compatibility with real tunnel cards

This commit is contained in:
Izaya 2019-12-20 02:14:03 +11:00
parent 36d5df5fcc
commit b938640625

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 proxy.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