This is a simple chat protocol I'm working on every once in a while in ANSI-C just for fun. I try to keep it as pure ANSI-C so that I'm able to compile and run it on my Amiga computer.
SAS/C 6.50+
You may need to change the library locations in the smakefile to fit your installation.
The handshake is as follows.
After connecting to the server the client sends:
AHOY
The server responds with:
AHOY-HOY:{access_token}
Where the access token is a random string, for example
AHOY-HOY:abcdef1234
The handshake is now complete and the client should store the access_token for use with subsequent messages.
The message format is vaguely inspired by the IRC protocol and the format is as follows:
:{access_token}:{nickname}:{message_type}:{message}
Newline character determines the end of a message. Regular chat messages have the message_type "normal". An example message could be
:abcdef1234:hackerman:normal:I'm gonna hack you!
Commands have the message_type "command". Chat history could be requested with:
:abcdef1234:hackerman:command:history
Run make and the server and client programs should be compiled.
Run smake and the client should be compiled. Server is not yet ported for the Amiga.
The current implementation consists of two programs: server and client. They can be found under the bin/ directory after a successful compile.
The server runs on the port 8002. You can provide an IP address as a command line argument for the client. If no argument is provided "127.0.0.1" is used by default. Only IP addresses are accepted at the moment (no domains).
Multiple clients can connect to the server and they see each others messages.