Let's say my IP is 198.51.100.27 and my friend's IP is 203.0.113.11. We both are connected to internet behind a standard consumer ISP router.
How can we send a few bytes to each other without using a 3rd party server? (and without having to do router port forwarding configuration)
I've heard about netcat or ncat but I'm not sure how I could use it to send "hello world" to my friend, and how he would see this message in his terminal
Should he do:
ncat -C 198.51.100.27 80 # this IP is mine
and me:
ncat -l 203.0.113.11 80 < echo "hello world" # this IP is my friend's IP
?
I'm even not sure if netcat / ncat is the right tool for this. I also looked at chownat / pwnat but I couldn't figure out how to use it in such a simple example: just sending / receiving "hello world".
Notes:
I don't want to connect to my friend's computer via SSH or SFTP. I just want to send him "hello world" or send short text messages to each other.
I don't have a precise goal other than just understanding how bytes can be sent directly peer-to-peer without a centralized server. So if I can just send him one or two bytes, such that he sees them in his console, that will be fine!