Java applet
There are several open-source implementations of the telnet protocol.
Here's a list from SourceForge.
For this project, I used a java implementation, called
The Java Telnet Application. It implements
telnet
, SSH and
VT, and is available
as a java applet and a stand-alone java application.
Its distribution license is GNU GPL,
which means I'm allowed to distribute it with modified source code and appropriate acknowledgment.
I used the java applet code and extended it to demonstrate features of the
telnet protocol discussed throughout this site:
- I added some code that gives the ability
to specify the remove host you'd like to connect to (it can be any kind of VT/telnet host)
- I added code that shows message boxes with interesting bits from the telnet communication
that goes on between the applet and the host: the negotiation of the telnet options
and responding to telnet commands.
To use the applet:
- Since this is a java applet, you need Sun java plugin (JRE) to use it.
It is possible to use either JRE 1.4.0, or JRE 1.4.2. If you don't have any
of them, download 1.4.2 from Sun - here.
You can either get the JRE or the JDK. For this applet you need only the JRE.
-
After downloading and installing it, configure Internet Explorer to use it.
Go to Tools --> Internet Options --> Advanced --> Java (Sun) --> check the option
"Use Java 2 1.4.2(0) for applet (requires restart)". Close all open browser windows.
-
Applet usually have a lot of built-in security restrictions. For this demonstration,
we need to give some default permissions to the telnet applet, that are not given
by default. For example, since we would like to connect to a remote telnet host,
we need to allow the applet to connect to remote hosts (by default, this is not allowed).
To achieve this, save the following file:
java.policy
- Open the folder where the JRE/JDK is installed. Usually it will be
c:\program files\java\j2re1.4.2\. There, navigate to \lib\security.
Rename the existing java.policy to java.policy.org and copy the file you downloaded instead.
- Now you are ready to test the applet! This is the link:
java telnet applet
- If you get Explorer warning bar, click it and choose "allow blocked content", and click "Yes".
- In this dialog, enter the VT host address and click OK (or just click OK to use the default one:
- Upon connection to the host, the applet will display the telnet commands
and negotiation options. Click OK to close the protocol messages:
- To type, click somewhere within the applet's black panel and type:
-
Don't forget to replace the downloaded java.policy file with the original one after you have
finished using the telnet applet.