1
0
mirror of https://github.com/ShadowKatStudios/OC-Minitel.git synced 2024-11-23 10:38: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() proxy.last = computer.uptime()
end end
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) event.listen("internet_ready",proxy.read)
listeners[addr] = {"internet_ready",proxy.read} listeners[addr] = {"internet_ready",proxy.read}
timers[addr] = event.timer(cfg.rtimer, proxy.read, math.huge) timers[addr] = event.timer(cfg.rtimer, proxy.read, math.huge)
@ -113,6 +123,11 @@ function settimer(time)
savecfg() savecfg()
end 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) function addpeer(host,port)
port = tonumber(port) or 4096 port = tonumber(port) or 4096
local t = {} 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)) print(string.format("Added peer #%d (%s:%d) to the configuration.\nRestart to apply changes.",#cfg.peers,host,port))
savecfg() savecfg()
end 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) function delpeer(n)
n=tonumber(n) n=tonumber(n)
if not n then if not n then