Telnet somehow is just a TCP connection, I have tried on module that to telnet to a public TCP server, it still connects.
root@fx30:~# telnet a1o5neajgmytt9-ats.iot.eu-central-1.amazonaws.com 8883
Console escape. Commands are:
l go to line mode
c go to character mode
z suspend telnet
e exit telnet
You can shut down firewall by:
iptables -I INPUT -j ACCEPT
Btw, is real IP address inside program working?
You can see below case: