mirror of
https://github.com/ShadowKatStudios/OC-Minitel.git
synced 2024-11-26 03:48:06 +11:00
Compare commits
2 Commits
36d5df5fcc
...
effcadc915
Author | SHA1 | Date | |
---|---|---|---|
effcadc915 | |||
b938640625 |
@ -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 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
|
||||||
|
Loading…
Reference in New Issue
Block a user