Chat on the terminal over the local network.
Tested only on Linux.
Download the binary and run it:
./lanchat -u my_user
Run ./lanchat -h
to see available flags. Besides command line flags, options can be passed via a configuration file (see the configuration file section below).
The program automatically detects if there's already a running Lanchat server in the local network and connects to it. If there isn't, the command starts one on port 6776.
Start typing to chat, or run one of the available commands (enter :help
to see what these are).
Download repository and run make
.
- Handle broadcasts properly (host should forward messages to all clients)
- Fix handling of :id command: change own label
- Transmit administrative messages to all peers (e.g. "user 'bla' connected")
- Add notifications with a cooldown
- Configuration file
- Become host if previous host disconnects; ping peers periodically
- Add :help command
- Every peer should know about all others, not just the host.
- Use peer information to make host reelection more reliable
- Show current peers with :info
- Show currently connected peers on a side tab
- More tests
- Move to Go 1.18. There are functions that could be merged with generics (compareUIPackets and compareNetPackets, for example). Add fuzzing tests.
A crude integration test can be run with make check
. It creates a chat with few users and runs some commands for inspection.
The app is separated into two components:
Client
: Handles networking, sending and receiving messages, scanning for peers. It also parses both outbound and inbound messages to process commands (messages starting with:
)UI
: Responsible for handling the user interface, both the chat window and notifications.
Client and UI communicate to each other through two channels. For example, if the client receives a regular message, it will forward it to the UI to be rendered.
A filepath can be passed to lanchat for configuration with:
./lanchat -c my_config.toml
Below is an example TOML:
username = "icarus" # default 'noone'
port = 6777 # default 6776
local = true # default false
notify = false # default true
force-host = true # default false