- Client side requirements:
- Server side requirements:
- Testing done:
- Server side installation on UNIX and Linux:
- Server side installation on Windows NT:
- The configuration file:
- How do I add this public chat to my homepage?
- Registration and pricing:
- Buy source code on-line US $25.--
- The address:
MiniChat2 is a chat application it consists out of a client and server part.
Both sides are written with the Java language.
(The server side is also availble as Win32 native *.exe file)
The client side consists of two Java applets.
One is used to chat and the other only displays a connected user list.
Both of these applets connect to a different port on the server.
If this talk seems to technical please read on.
I will also provide you with an easy way to install the chat on your homepage.
The chat port is number 8081 by default.
The port that sends the connected user list is always one higher.
Client side requirements:
-A Java 1.02 compatible browser.
(This includes all major browsers Netscape version 3 or higher and Ms Explorer version 3 or higher.)
Today on Windows XP you have to install the java from http://www.java.sun.com (minimum runtime envierment)
The minimum is the runtime averment.
This due to the marketing strategy of Microsoft. :-)
Server side requirements:
-It should run on any operating system with Java 1.1.x installed.
You can download Java from http://java.sun.com (JRE or JDK or SDK)
-There also is a *.exe file for Windows32 operating systems.
This exe file uses the Java Virtual Machine of the Ms Explorer browser (4.0 or higher)
Because of this it's a very small file 41 KB at the moment.
It requires the Ms Explorer browser to be installed.
- Linux RedHat 5.1 with JDK 1.1.7 (port from blackdown.org).
- Linux RedHat 5.2 with JDK 1.1.7 (port from blackdown.org).
- Linux RedHat 7.0 with SDK 1.3 (Sun)
- Windows NT server (*.exe file)
- Windows NT workstation 4.0 SP6 on LAN (telnet test SDK 1.3 and *.exe file)
- Windows 98 on LAN (telnet test with *.exe file)
Server side installation on UNIX and Linux:
First of all install Java on your server.
As an example see: http://alpha.comweb.nl/others/JavaOnRedHat7_0.html
Go to the directory that contains the MiniChat2 server class files.
The type: java MiniChatServer.
To start it at the background type: java MiniChatServer &
Peace of cake; but what if you reboot the server?
It's better to add the MiniChat2 server to your startup files.
The last script executed on RedHat 7.0 is /etc/rc.d/rc.local
So adding a simple line at the end will do.
Security tip use: su nobody -c 'command'
This will start the server with user nobody.
Sometimes you will need to use the absolute path to the java.exe file.
Also many times you need to use the -classpath option of the java.exe program.
Classpath points to the language class files.
On Java version 1.1.x they are stored in classes.zip
On Java 1.2 and 1.3 they are stored in rt.jar.
You also need to point classpath to the directory containing the MiniChat2 classes.
On my old RedHat5.2 this looks like:
su nobody -c '/usr/local/jdk117_v3/bin/java -classpath /usr/local/jdk117_v3/lib/classes.zip:/home/rvdb/Server MiniChatServer >/dev/null &'
Server side installation on Windows NT:
- You could run it from the dos prompt with the javaw.exe command.
You can kill the program with the taskmanager.
Look for something with javaw.
- I do not like this way so I've created an exe file.
Simply double click on the MiniChat2Console.exe file.
There is a dos window that stays open.
Control^c will kill the server.
- There is also a version MiniChat2.exe that starts it as background process.
You can kill the program with the taskmanager.
The configuration file:
This upgrade reads a configuration file MiniChat2.config
This way you can create multiple rooms with one command.
I've added comments to the configuration file on how to set it up.
How do I add this public chat to my homepage?
To use this chat you don't need to have your own computer permanently connected to the Internet.
Simply add some html tags to your home page will do.
This way you visitors will use the server software on the Comweb server.
Here is what you need to add between your <BODY> and </BODY> tag.
<APPLET CODEBASE="http://alpha.comweb.nl/java/MiniChat2/" CODE="MiniChat2.class" WIDTH="450" HEIGHT="300">
<PARAM NAME="panel_background" VALUE="#0096B0">
<PARAM NAME="button_background" VALUE="#0096B0">
<PARAM NAME="button_foreground" VALUE="#FF0000">
<PARAM NAME="text_component_background" VALUE="#FFFFFF">
<PARAM NAME="text_component_foreground" VALUE="#000000">
<APPLET CODEBASE="http://alpha.comweb.nl/java/MiniChat2" CODE="UserBox.class" WIDTH="150" HEIGHT="300">
<PARAM NAME="background" VALUE="#FFFFFF">
<PARAM NAME="font" VALUE="TimesRoman|plain|12">
<PARAM NAME="foreground" VALUE="#000000">
Well pretty easy I think.
Most parameter names here are colors.
You don't need to change them but you can.
Note that the colors values used start with a # sign.
It's a hexadecimal RGB representation of a color.
Wow that sounds difficult.
It's also used with the bgcolor attribute of the <body> tag.
So a good html book will explain it.
#FFFFFF = white
#AAAAAA = some gray
#888888 = some darker gray
#000000 = black.
#FF0000 = red
#00FF00 = green
#0000FF = blue
(Remember RGB means Red Green Blue)
#12AD9A = some wild mix of the RGB colors
The applet doesn't understand color names.
There are simply to many of them.
My first attempt was a Java applet that periodically queried the provider's server to see if there were new messages.
It used a Perl CGI script installed on the server.
It worked for a small number of users.
But it didn't work on a server with heavy load.
Because the connection where not persistent.
So on every query a new connection had to be established.
Starting the big Perl interpreter every time did take some resources.
The result was that the chat connection often timed out.
So I needed to write a server side application that created persistent connection.
So the first version of MiniChat2 was born.
A request was made to display a connected user list.
So a second client applet was written and the server part was extended.
The server now uses a second server socket to listen for incoming connections.
This second socket only transmits a list of connected users.
It was an easier solution than rewriting the applet.
This version already got a 25% rating by jars.
Second problems where request from NT server users.
It's a little problematic to configure.
The server part was written as console application on UNIX.
So to make things easier I did change the server part.
It now can read its configuration from a file.
This way I was able to compile it to a native Windows32 exe file.
It also had to be small and one file.
Well I think 41 KB is an extremely good result.
The exe file does use the Ms Explorer's Java Virtual Machine.
Quite simple the use of this applet or server part is at own risk!!
Registration and pricing:
On-line Paypall payments are possible:
- The use of the public room on comweb.nl is free.
(Simply copy and paste the applet tags mentioned on this page.)
A link to http://www.comweb.nl is appreciated
- The use of the MiniChat2.exe file on your server is free if you provide a link on the page to http://www.comweb.nl.
You can download it here -> MiniChat2exe.zip
- The source codes aren't free.
You can buy the on-line for US $125.--.
If you want we will install it on your unix/lunix server but on your own risk.
payment information stands below.
If you want another payment method mail email@example.com
Chamber of Commerce 09107249, Arnhem
Tax number: NL 163775874B01 (for European costumers only)
Street: Aldenhof 3090
Postal code: 6537AE
PostBank Account 8359163, BIC=swiftcode INGBNL2A
IBAN: NL 72 PSTB 0008 3591 63
© 2001 RJHM van den Bergh/Comweb.nl , All Rights Reserved.