Chapter 9. Typing Across the Internet: The Intercom Project
Here's another fun onethe Intercom project, which lets two people type across the Internet. You just start up the project, connect with the click of a button, and you've got your own connection: Everything you type into the intercom, the other user can see; everything he or she types, you can see. Prestoyour own private intercom over the Internet.
Using the Intercom, you can communicate between two machines anywhere in the worldjust type your text, which will appear in the other person's intercom, and his or her reply text will appear in your window.
This one's much like the messenger programs you see all around, except that it's even betterno messenger service needed, no third-party site needed, no mysterious code to install. You don't even need an ISP that can run Java onlineall the code is on your machines at home. You're running your own Internet server from your computer.
To run this project, all you need are two machines connected to the Internet, and Java. The only stipulation is that one intercom is able to find the other, which means you'll need a fixed Internet IP address for Intercom 1which, if you're connected to the Internet via broadband, you almost certainly already have.
There are two applications hereIntercom 1 and Intercom 2. Only Intercom 1 needs to be run on a machine with a fixed IP address of the kind you get with a broadband connection; you enter that IP address into Intercom 2 so it knows where to find Intercom 1. For example, you can find what your fixed IP address is in Windows by finding the Broadband icon in the Control Panel and double-clicking it; your IP address should be listed there. If you can't find that IP address on your machine, get in touch with your broadband provider and ask about it. They should be able to tell you how to find your IP address.