Can be used to establish a 1 to 1 chat across any TCP network with static IP addresses, such as a LAN or WAN.
Open a terminal
- Start the server
node --harmony tcp-chat-server.js
- Give it your name
- Wait for a connection
- Start chatting
In another termal
- Start the client
node --harmony tcp-chat-client.js
- Give it your name
- Start chatting
A port can be specified as the first command line argument:
node --harmony tcp-chat-server.js 3000
An IP address can be specified on the client as the first command line argument:
node --harmony tcp-chat-client.js 192.168.1.11
A port can be specified on the client as the second command line argument, but if so an IP must be specified:
node --harmony tcp-chat-client.js 192.168.1.11 3000
Thanks, bro