Ngrok desde Telegram

Este flujo permite atraves de un bot de Telegram y Node Red, activar/desactivar un tunel inverso Ngrok, quedando accesible Node Red desde internet. Es conveniente activar el password de Node Red.

[{"id":"529e07c5.70c008","type":"telegram receiver","z":"65760b09.425164","name":"prueba_bot","bot":"850635e4.e6d708","saveDataDir":"","x":180,"y":140,"wires":[["831fbf0.97b724"],[]],"outputLabels":["msg.payload",""]},{"id":"46c00cfb.237704","type":"telegram sender","z":"65760b09.425164","name":"","bot":"850635e4.e6d708","x":830,"y":260,"wires":[[]]},{"id":"c8bffea9.abb38","type":"ngrok","z":"65760b09.425164","port":"1880","creds":"273f25f1.62e2da","region":"eu","proto":"http","subdomain":"","name":"","auth":"","x":510,"y":260,"wires":[["6e8f6c72.543df4","69faf945.882ff8"]]},{"id":"6e8f6c72.543df4","type":"function","z":"65760b09.425164","name":"","func":"msg.payload = { chatId : xxxxxxxxx , type : 'message' , content : msg.payload }\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":260,"wires":[["46c00cfb.237704"]]},{"id":"5c97b296.d1460c","type":"inject","z":"65760b09.425164","name":"","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":260,"wires":[["c8bffea9.abb38"]]},{"id":"56d8d7f4.5cb0a8","type":"inject","z":"65760b09.425164","name":"","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":340,"wires":[["c8bffea9.abb38"]]},{"id":"69faf945.882ff8","type":"debug","z":"65760b09.425164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":670,"y":200,"wires":[]},{"id":"831fbf0.97b724","type":"function","z":"65760b09.425164","name":"","func":"if(msg.payload.content == \"ngrok on\"){\n    msg.payload = \"on\";\n    return msg;\n}\nelse if(msg.payload.content == \"ngrok off\"){\n    msg.payload = \"off\";\n    return msg;\n}\nreturn null;","outputs":1,"noerr":0,"x":350,"y":200,"wires":[["c8bffea9.abb38"]]},{"id":"850635e4.e6d708","type":"telegram bot","z":"","botname":"xxxxxxx","usernames":"","chatids":"","baseapiurl":"","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"","socksusername":"","sockspassword":"","bothost":"","localbotport":"","publicbotport":"","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false},{"id":"273f25f1.62e2da","type":"ngrokauth","z":""}]

Flow Info

Created 5 years, 1 month ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x1)
  • function (x2)
  • inject (x2)
Other

Tags

  • Ngrok
  • Telegram
  • NodeRed
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option