SourceForge.net Logo

Internal Chat
Multiplatform Enterprise Instant Messaging

Table of Contents

  1. Description and license
  2. History
  3. Features
  4. Screenshots
  5. System requirements
  6. Installation
  7. Enabling SSL
  8. Known issues
  9. To do
  10. Download
  11. Acknowledgements

Description and license

Internal Chat is a corporate client-server chat (instant messaging) application. It is written completely in Java and thus can be run on any platform that supports Java.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

History

I started this work in the second half of 2002. By that moment I had been searching for an intranet instant messenger. We used one of those, but it was based on mailslots, and thus it could not be run in a terminal server environment, and but we planned to move towards thin clients.

I had tested some messengers (ICQ corporate, a Jabber clone, MS Exchange IM, and some others that I don't even remember), but none of them satisfied me for various reasons. So I concluded that the best solution was to start my own project.

  1. October, 2002. v.1 is ready. Just a test version, not a client-server - only to check some ideas. C++, WinAPI, closed source.

  2. December, 2002. v.2 is ready (another proto). A test version too. Client-server. C++, WinAPI, closed source.

  3. February, 2003. v.3 is ready. A new proto, data as XML, XML database on both client (history) and server (deferred messages) side. C++, WinAPI, closed source.

    v.3 was the first production release.

  4. April, 2004. v.4 is ready. A new binary proto (ICQ-like), no client history (because XML-files became too big and required too much resources to parse and to work to), all the history is kept on the server. MySQL and PostgreSQL support. C++, WinAPI, closed source.

  5. April, 2007. v.5 is ready. Proto is XML over HTTP. The main reason to make this version was a request for multiple OS support. We started to use Linux and MacOS and needed to give all the users access to all the corporate services. Java, open source (I made this work at my free time, so feel no obligations to anyone), PostgreSQL support. I use Jetty in the embedded mode as the HTTP server part of Internal Chat Server from v.5.5.

At the moment Internal Chat is used in two companies with the average number of active (simultaneous) users about 200 (more than 300 in total) for each server instance. System requirements are specified below.

Features

  1. Instant messenger. Users are able to send messages and files. The server can be put inside the internal network and thus you do not have to worry about open networks security.

  2. Very simple for both users and system administrators.

  3. HTTP is used as transport protocol.

  4. SSL is supported.

  5. The number of defined message types is arbitrary.

  6. You can define your own template for every message type. For example, you can define tasks or some helpdesk boards (by now it must be programmed but in future I plan to make it look like plugins or server-side modules). By default two message types are defined in system: files and "common" messages.

  7. Added and removed users become available/unavailable immediately for all other users. No user interaction (like adding user into your contact list in ICQ) is needed.

  8. There are recipient lists for frequently used groups of recipients.

  9. Work time is counted (with an account of the periods when user does not work with his/her computer).

  10. History is kept on the server side and thus users will never loose their messages.

  11. The application is multiplatform. You can work with it under your favorite OS without any problems.

  12. The application is ready for internationalization (i18n). All the international data is stored in special files, so one just needs to translate it into the desired language. I made en_US (default) and ru_RU translations.

  13. There are many more features :)

Screenshots

You can find some screenshots in the screenshot section of the project. They were made under en_US locale in Windows XP Pro Rus with the Windows XP Look'n'Feel.

System requirements

Server

  1. OS: any OS with Java. JDK 5+.

  2. PostgreSQL (no specific version requirements) or MySQL v.4.1+ (because UTF8 support is needed)

  3. Server must have enough RAM. For example, if you have about 100 simultaneous online users connected, your server must be like P4 3GHz, 2GB RAM. 4GB is recommended.

Client

  1. OS: any OS with Java and graphical desktop. JRE 6+. Note for MacOS users: there is yet no JRE 6 for your platform, but it's possible to use a beta-version, available from MacOS developers' site.

  2. No specific hardware requirements, but 512MB of RAM is recommended (alas, it's Java).

Installation

Database

The description below is for PostgreSQL. If you use MySQL all is the similar (except specific commands).

  1. Download the initial database script init_database_ic_postgresql_YYYYMMDD.sql from this site.

  2. Install PostgreSQL (out of the scope of this article).

  3. Create a user to work with the database (we will call him "icuser"):

    #su - postgres
    #createuser -A -d -P icuser
    enter a password for the user when prompted

  4. Create and initialize database (we will call it "ic"):

    #createdb -O icuser -E UTF8 ic
    #psql -U icuser -f init_database_ic_postgresql_YYYYMMDD.sql ic
    #exit

    This script creates an initial database structure with one group (IT Department) and one user (System Administrator, login "admin", password "admin", timezone GMT, locale en_US)

  5. If PostgreSQL is installed on a server other than that where you plan to install Internal Chat Server, make sure that PostgreSQL will accept connections (edit pg_hba.conf if needed) from that server.

Server

  1. Download the server package IntChatServer-X.Y.Z.zip from this site.

  2. Unpack IntChatServer-X.Y.Z.zip into some folder FOLDER (something like c:\IntChat\Server on Windows or /usr/local/IntChat/Server on *NIX)

  3. On Windows edit FOLDER\run.cmd to correct the path to javaw.exe; on *NIX edit FOLDER/run.sh to correct the path to java.

  4. Unpack the file avoware/intchat/server/etc/Server.xml from the archive FOLDER/IntChatServer.jar

    #$JDK_HOME/bin/jar xf FOLDER/IntChatServer.jar avoware/intchat/server/etc/Server.xml

    and edit it. You will need to edit at least the following parameters:

  5. Pack the edited file Server.xml back to FOLDER/IntChatServer.jar, avoware/intchat/server/etc/Server.xml, overwrite the previous one:

    #$JDK_HOME/bin/jar uf FOLDER/IntChatServer.jar avoware/intchat/server/etc/Server.xml

  6. Run run.cmd (on Windows) or run.sh (on *NIX, make sure that EXECUTE file system attribute is set for this file) - the server should start. You can examine its log to make sure that everything is working properly.

Client

  1. Download the client package IntChatClient-X.Y.Z.zip from this site.

  2. Unpack IntChatClient-X.Y.Z.zip into some folder FOLDER (something like c:\IntChat\Client on Windows or /usr/local/IntChat/Client on *NIX)

  3. On Windows edit FOLDER\run.cmd to correct the path to javaw.exe; on *NIX edit FOLDER/run.sh to correct the path to java.

  4. Run run.cmd (on Windows) or run.sh (on *NIX, make sure that EXECUTE file system attribute is set for this file) - the client should start.

    IMPORTANT UPDATE FOR WINDOWS USERS (2007-11-24). I have added the Win32 wrapper to the binary distro - IntChatClient.exe. There is no need to edit run.cmd from now - just run IntChatClient.exe, it will search itself for available JRE and will use it. Of course, you can keep on using run.cmd with some specific Java command line parameters, if needed.

Server as service (daemon)

There are two ways to start Internal Chat Server under Windows as a service. The first way is much more simple, but the second is much more powerful from the JVM-tuning point of view.

The way #1

I have added the Win32 service wrapper to the binary distro - IntChatService.exe. Just run it from the command line with the key install, and it will be installed as Windows service called "Internal Chat Server 5" (short name "IntChatService5"):

>IntChatService.exe install

To start/stop it, use Service Management Console, or prompt:

>net start/stop IntChatService5

To uninstall:

>IntChatService.exe uninstall

Useful tip. I suppose that it is more flexible to run the service under some specific user account rather than SYSTEM account. So I recommend to change this setting for the service.

Useful tip #2. First of all, IntChatService.exe searches for JVM in registry ("HKLM\Software\JavaSoft\Java Development Kit" and "HKLM\Software\JavaSoft\Java Runtime Environment"), trying to find parameter RuntimeLib. By default, this parameter points to the client JVM library (%JRE_HOME%\bin\client\jvm.dll). But it is more reasonable to use server JVM library with Internal Chat Server. This library is not shipped with JRE, but it is shipped with JDK. Sun Corporation recommends just to copy the whole folder %JDK_HOME%\jre\bin\server to the %JRE_HOME%\bin (thus it will be client and server folders there), and you will get both the client and server VMs. If you start now your java-application with the "-server" command line parameter ("java -server -jar SOME_JAR.jar"), it will use server JVM. But not in the case of our registry searching. In the case you must go a little further: to change registry parameter RuntimeLib (see above) to "%JRE_HOME%\bin\server\jvm.dll". After that Internal Chat Server will start using server JVM.

The way #2

On Windows you can use well-known resource kit tools instsrv.exe and srvany.exe (the last one allows to run any executable as Windows service), see http://support.microsoft.com/kb/137890 for more info:

  1. Create a user-defined service (we will call it IntChatService):

    >instsrv IntChatService PATH_TO_SRVANY_EXE\srvany.exe

  2. Run Registry Editor (Regedt32.exe) and locate the following subkey:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IntChatService

  3. From the Edit menu, click Add Key. Type the following and click OK:

    Key Name: Parameters
    Class: leave blank

  4. Select the Parameters key.

  5. From the Edit menu, click Add Value. Type the following and click OK:

    Value Name: Application
    Data Type: REG_SZ
    String: FOLDER\run.cmd (remember that FOLDER is the place where we unpacked IntChatServer-X.Y.Z.zip)

  6. Close Registry Editor

  7. Now you can run IntChatService as a common Windows service, either from the command line or from the Services applet.

Note: there is a problem to STOP the service, created this way. If you tell the service to stop, it will stop only the "Windows half" of the service. The Java-process will continue to run. You will need to kill it explicitly from the Task Manager, so it is important to make the process run not under the SYSTEM account, but under some user (for example, Administrator) account. The process owner can be set via the Services applet, through IntChatService properties, Log On tab.

On *NIX there is no problem to create startup system daemon script suitable for your system.

Enabling SSL

SSL encryption of Internal Chat traffic is turned off by default. But if you plan to use Internal Chat from outside of your network (for example if your server listens for user requests on public IP) it is highly recommended that you enable SSL.

Internal Chat Server is shipped with test certificate. You can use it for test purposes, but not in production!

To enable SSL you must do the following:

  1. Create your own Java Key Store (JKS) with your certificate. The easiest way to do it is to use IBM's KeyMan tool. Another way is to use keytool (command line tool, shipped with JDK) or OpenSSL.

  2. Pack the JKS-file my.jks into IntChatServer.jar, subfolder avoware/intchat/server/etc/

  3. Edit Server.xml (see above), set:

Now your Internal Chat Server is configured to use SSL with your own self-signed certificate. Do not forget to check "Use SSL" box in connection settings on all the clients!

If you need some more information about configuring SSL support in Jetty, you can find it here.

Known issues

To Do

  1. Regular Linux startup scripts.

  2. Multiserver architecture, server-to-server interactions, some piece of data replication, ACLs.

  3. Server side message templates. Not just chat application, but some kind of a platform for arbitrary message types, working in nearly real time.

Download

Just go to the SourceForge download page.

Acknowledgements



Sincerely yours, Andrew Orlov, 2002-2008