Home > Power Computing > Setup a telnet chat server with STChat.

Setup a telnet chat server with STChat.

January 29th, 2010 Jimmy Leave a comment Go to comments

STChat is a simple telnet chat server that runs on Linux, Windows and MAC. I’ve only tested this on Linux so i can’t speak for the other OS’s. The chat system is really simple, supports colors, multiple terminal types (vt100 etc), usernames and admin mode. Putty, Linux telnet, and Windows telnet seem to work just fine when connecting to the chat server. No special installation is needed except that you do need a Java Runtime Environment (JRE) to run the server. Simply unpack the package and run ‘java stc 2020` to start the server on port 2020. If you want to run STchat on the standard telnet port, port 23, you’ll need to run the server as root. e.g. java stc 23

STChat comes with the complete source. Some of the code is deprecated but you can simply ignore these messages at compile time. Note: Default compiled binaries are included so don’t worry about this unless you plan to modify the source code. The STChat project page is located here.

Commands available to all users:
\help:
Prints a help screen
\nick newnick:
Changes your nickname to “newnick”. You can use quotation marks if you nickname
contains spaces.
\color number:
Change your message colour to colour “number”. Enter \color without a parameter
to get a list of colours.
\list:
List all users currently logged in. The administrator will be shown additional information
like client IP and port number.
\detach:
If you enter this command you wont get messages from other users.
\attach
Re-enable message dispatching after entering \detach
\secho [on|off]
Enables or disable key echo from server.
\quit:
Close connection.

Commands available to all users:
\help: Prints a help screen
\nick newnick: Changes your nickname to “newnick”. You can use quotation marks if you nickname contains spaces.
\color number: Change your message colour to colour “number”. Enter \color without a parameter to get a list of colours.
\list: List all users currently logged in. The administrator will be shown additional information like client IP and port number.
\detach: If you enter this command you wont get messages from other users. \attach Re-enable message dispatching after entering \detach \secho [on|off] Enables or disable key echo from server. \quit: Close connection.

Commands for the administrator only:

\def xxx commands set defaults which apply to all clients or all future clients

(depending on setting).

\logfile file:

Sets the name of the current logfile. Be careful: Existing files

are overwritten without prompting!

\kick nickname:

Kick the user with nickname “nickname”.

\killserver:

Terminates the server-process.

\log user1 user2 …:

Log messages of the given users. Use \log * to log all user activity.

\log without paramters diables logging of all users.

\def serverecho [on|off]:

Defines whether the server will echo key.

\def dump2con [on|off]:

Defines wheter the server will dump all user messages to stdout.

\def fancy  [on|off]:

Defines whether the server will use VT100 commands.

\def jokes [on|off]

This setting defines whether the server will print joke messages in

certain situations.

\def ipblock [on|off]:

Enables or disables the autoblocking mode.

\def ipblocktime …:

Sets the autoblocking timeout in minutes.

\clearblock:

Clear the list of currently blocked IPs.

\listblock:

Shows the list with currently blocked IPs.

\def adminname …:

Sets the user which will be recognized as administrator.

\def adminpw …:

Sets the administrato’s password.

\def logfile …:

Sets the logfile which will be opened on startup.

\def maxlps …:

Sets the maximum-lines-per-second quota.

\def maxconns

Sets the macimum number of concurrent connections.

\listdef:

Show the server settings.

\cleanconfig:

Generates a new “factory default” configuration.

\wrconfig:

Writes the configuration to config.xml

\rdconfig:

Loads the configuration from config.xml

\clearlog:

Clears the current logfile. (Simply deletes it.)

\dumplog:

Prints a dump of the logfile.

Digg: DIGG ME
  1. No comments yet.
  1. No trackbacks yet.