这是什么?
Anonchat 是一个使用 Dart 和套接字构建的微型通信协议。
服务器充当连接客户端之间的消息分发器,而客户端可以发送和接收消息。
典型的 v2 消息如下所示:
{"user": "calamity", "msg": "hey, how you doing today?"}
构建
如果您想构建客户端和服务器,您需要获取 **Dart SDK (https://dart.ac.cn/get-dart)** 和 **git**。
要运行服务器,您需要为您选择运行服务器的端口进行端口转发。
说明
# 1. Clone the repository
git clone https://github.com/anonchat-org/anonchat-v2.git
cd anonchat-v2
# 2. Build the executables
# If you want to build for other platforms - see `dart compile`
# A build script is provided - `./build.sh`
mkdir build
dart compile exe anonchat-server/bin/anonchat_server.dart -o build/server && chmod +x build/server # for server
dart compile exe anonchat-cli/bin/anonchat_cli.dart -o build/cli && chmod +x build/cli # for cli client
构建好的可执行文件将在 build 文件夹中。
运行
在从 发布页面 下载二进制文件后,将它们放在您需要的位置。
假设您需要连接到一个 IP 地址为 example.com 且端口为 2345 的服务器。
示例:./cli example.com:2345
默认情况下,这将为您提供匿名(Anon)的昵称,但如果您需要表明身份,可以添加一个昵称参数。
示例:./cli example.com:2345 bob
