A simple chat server for the Morserino.
Find a file
2023-10-06 08:40:42 +02:00
src debug messages added 2023-10-06 08:40:42 +02:00
systemd RUST_LOG added. 2023-10-06 08:06:28 +02:00
.gitignore Initial commit 2023-10-02 21:52:22 +02:00
Cargo.lock Debugging messages added 2023-10-03 22:11:06 +02:00
Cargo.toml Debugging messages added 2023-10-03 22:11:06 +02:00
README.md Installation instructions 2023-10-06 08:00:51 +02:00

m32chat

m32chat is a simple chat server for the Morserino.

It is (more or less) a reimplementation of the Python2.7 script m32_chat_server.

The m32chat service listens on port 7373 for UDP messages and rebroadcasts them to the other subscribed Morserino clients.

To subscribe to the service, just send the message hi from your Morserino. The server will respond with :hi and the number of clients connected (1 means you're alone).

If a client is inactive for a certain time, it will be removed from the subscriber list. The server then sends the message :bye to this client. You can also force the removal by sending the message :bye.

Additional notes:

  • Periodically, empty UDP packets are being sent to avoid NAT timeouts.
  • The number of clients is restricted (to avoid abuse).
  • A small delay is introduced (to avoid abuse).

Installation

For compiling m32chat, you only need a recent Rust toolchain. rustup.rs could help you with it.

  • After getting the source code, you can compile it with cargo build --release.
  • Copy the binary for example to /usr/local/bin/.
  • You can use the systemd template for m32chat and adapt it to your needs (i.e. customize the user name under which the service should run).

Setting the environment variable RUST_LOG=Debug will give you some debug messages.