From b155f1e812900f11e90824725d251e856774bb3a Mon Sep 17 00:00:00 2001 From: Christian Zufferey Date: Sun, 9 Feb 2020 14:42:51 +0100 Subject: [PATCH] =?UTF-8?q?Mon=20petit=20tunnel=20reverse=20telnet=20comme?= =?UTF-8?q?nce=20=C3=A0=20bien=20fonctionner,=20faut=20que=20je=20l'automa?= =?UTF-8?q?tise=20encore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mesures/ADC/ADS1115/0_tst2_socat.lua | 28 ++++++++++++++----- .../ADC/ADS1115/{ => oldies}/0_tst1_socat.lua | 0 2 files changed, 21 insertions(+), 7 deletions(-) rename Mesures/ADC/ADS1115/{ => oldies}/0_tst1_socat.lua (100%) diff --git a/Mesures/ADC/ADS1115/0_tst2_socat.lua b/Mesures/ADC/ADS1115/0_tst2_socat.lua index 52a1e9d..86408db 100644 --- a/Mesures/ADC/ADS1115/0_tst2_socat.lua +++ b/Mesures/ADC/ADS1115/0_tst2_socat.lua @@ -1,15 +1,17 @@ -- tests connection reverse telnet -- commande à faire tourner sur le serveur --- socat TCP-LISTEN:4444,fork,reuseaddr STDIO +--[[ +socat TCP-LISTEN:23002,fork,reuseaddr STDIO +socat TCP-LISTEN:23002,reuseaddr,fork TCP-LISTEN:24002,reuseaddr +]] -print("\n 0_tst2_socat.lua zf200203.1734 \n") +print("\n 0_tst2_socat.lua zf200209.1442 \n") +srv_rt = net.createConnection(net.TCP, 0) +srv_rt:connect(console_port,console_host) +srv_rt:on("connection", function(sck) -srv = net.createConnection(net.TCP, 0) - -srv:connect(4444,"192.168.0.184") - -srv:on("connection", function(sck) + print("c'est connected...") function s_output(str) if(sck~=nil) @@ -24,6 +26,7 @@ srv:on("connection", function(sck) end) sck:on("disconnection",function(c) node.output(nil) + print("c'est disconnected...") --unregist redirect output function, output goes to serial end) print("Welcome to NodeMcu world.") @@ -34,6 +37,17 @@ end) --[[ + +print(srv:getpeer()) + +if console_port == srv:getpeer() then + gpio.write(zLED, gpio.LOW) +else + gpio.write(zLED, gpio.HIGH) +end + + + s=net.createServer(net.TCP,180) s:listen(2323,function(c) function s_output(str) diff --git a/Mesures/ADC/ADS1115/0_tst1_socat.lua b/Mesures/ADC/ADS1115/oldies/0_tst1_socat.lua similarity index 100% rename from Mesures/ADC/ADS1115/0_tst1_socat.lua rename to Mesures/ADC/ADS1115/oldies/0_tst1_socat.lua