An introduction to Networking with Netcat and NodeJS
Published 2013-3-14Watch on YouTube: youtu.be/iL6fWeJ_FfQ
Here's a quick overview of topics covered in the video:
IP Address
- Like phone numbers or house addresses
- Every computer calls itself
localhost
which means127.0.0.1
- Private networks (meaning intranets, NATs) have non-unique addresses
- 192.168.x.y
- 10.x.y.z
- 172.16.x.y to 172.31.x.y
- When no router is available to assign an address, a computer will give itself an address in the 169.x.y.z range
- Laptops, Phones, Printers, etc use can use mDNS and their name to find themselves by name such as
ajs-iphone.local
ormacbook-pro.local
TCP with Netcat
- When you use netcat, there's no magic, it's just stuff going across the wire
- When you use your browser on a netcat server you can see that http isn't crazy magic either
- Two computers can talk to eachother easily
- They can also share files
- All computers can create a connection with a server on the internet
- Computers on the Internet create connections to a computer on an intranet (the address only works one-direction)
Netcat in Node
- The
net
module handles TCP console.log
puts an extra newline when it logs things- The server can handle many clients simultaneously
- The client only speaks to one server
process.stdin
handles input from the terminal
By AJ ONeal
Thanks!
It's really motivating to know that people like you are benefiting
from what I'm doing and want more of it. :)
Did I make your day?
Buy me a coffee
(you can learn about the bigger picture I'm working towards on my patreon page )