🇻🇳 Tiếng Việt
A high-performance, real-time anonymous chat system built entirely in Go. It features a lightweight WebSocket server and a native CLI (Terminal) client. The system incorporates robust security measures, including asymmetric cryptography for passwordless authentication, anti-spam mechanisms, and role-based permissions.-
Lightning Fast and Lightweight: Pure Go implementation utilizing
gorilla/websocketfor real-time bidirectional communication. -
Asymmetric Authentication (Passwordless): Uses Ed25519 and HMAC for a Challenge-Response authentication mechanism. This allows Admins/Mods to log in securely without sending private keys over the network, effectively preventing Replay and MITM attacks.
-
Secure Anonymity: Users are anonymous by default. Display names are automatically appended with a short hash of the user's IP address (e.g.,
Anonymous#1a2b), making it easy to distinguish users without exposing real IP addresses. Now users can choose tripcode identity system. -
Anti-Spam and Abuse Protection:
- Maximum connection limits per IP address.
- Message length and line-break limits.
- Message and connection cooldowns.
- Temporary IP lockouts for repeated failed authentication attempts.
- IP spoofing and DoS preventation.
- Immediately block unencrypted connections to prevent MITM attacks and secret sniffing
-
In-Memory Chat History: Automatically stores and sends the most recent messages to newly connected users.
-
Cross-Platform CLI Client: A terminal-based client featuring an integrated chat UI suitable for multi-line messages and local commands.
Compiled binaries for various platforms (Windows, Linux, macOS, Android) are available in releases.
Run the executable matching your operating system and architecture (e.g., ./V2V-linux-amd64 or V2V-windows-amd64.exe).
Build the Client:
bash build_client.sh
The client runs directly in your terminal.
Join as a Guest:
./client -s ws://localhost:8080 -u "YourName"
Check Server Status:
./client -s ws://localhost:8080 -i
Join with a specific User-Agent:
./client -s ws://localhost:8080 -u "YourName" -a "Custom-Agent/1.0"
Once connected to a chat room, you can type /help to see manual.
Build the Server:
bash build_server.sh
Prerequisites: Docker installed.
-
Prepare Configuration Files: ensure you have your
.envandroles.jsonfiles in the project root directory. You can create them if they don't exist:touch .env roles.json
-
Build and Start the Server: run the following command in the project root directory. This will compile the Go binary inside the container and start the server in detached mode:
docker compose up -d --build
-
Check the Status: verify that the container is running:
docker ps
View Logs: to monitor real-time logs and see incoming connections:
docker compose logs -f V2V
The docker-compose.yml is configured to mount your local .env and roles.json directly into the running container. By default, Docker file mounts on logs folder. Therefore, you must change the log path to point to the location inside the logs directory.
You do not need to restart the container when updating roles or environment variables.
Simply edit .env or roles.json on your host machine, save the file, and the server will automatically detect the changes and reload the configurations on the fly.
-
To stop and remove the container gracefully:
docker compose down
-
Restart the server:
docker compose restart
Before starting the server, you need to configure your environment variables:
- The configuration templates are provided in
template/.env. - Copy this file and paste it into the project root directory of the project, renaming it to
.env. - Open the
.envfile and adjust the parameters to fit your setup (such as the server port, rate limits, allowed origins, etc). The server will automatically load these settings on startup.
The system allows special privileges through cryptographic keys rather than passwords.
-
Generate Keys: Run the client with the
-gflag to generate a secure key pair../client -g
This will generate
key.json(Private Key - keep this safe) androles.json(Public Key configuration). -
Setup Server: Place the generated
roles.jsonfile in the./directory on your server so it can verify your identity. -
Login: Connect to the server using your private key file:
./client -s ws://localhost:8080 -u "AdminName" -k /path/to/your/key.json