开源 · 轻量 · 跨平台Open source · Lightweight · Cross-platform

在网络最近处,测量真实往返时延 Measure real round-trip latency close to your network

WiFi Diag Echo Server 是一个无认证、无持久化的 WebSocket 回显服务。将它部署在局域网中,可减少公网路径和远端服务器对结果的干扰,更准确地判断 Wi-Fi 与本地网络质量。 WiFi Diag Echo Server is a stateless WebSocket echo service with no authentication or persistence. Run it on your LAN to reduce internet-path noise and measure Wi-Fi and local-network quality more accurately.

支持根路径 //ws,健康检查路径为 /healthzSupports / and /ws; health checks are available at /healthz.

echo-server
$ ./wifidiag-echo-1.0.1-linux-amd64 \
    -addr '[::]:8080'

INFO server starting
     address=[::]:8080
     tls=false
     version=1.0.1

$ curl http://127.0.0.1:8080/healthz
ok

# WiFi Diag
ws://192.168.1.10:8080
7平台产物build targets
0外部服务依赖external services
64 KiB默认消息上限default message limit

软件介绍Overview

只做回显,把诊断交给 WiFi DiagEcho only. Let WiFi Diag handle diagnostics.

服务端保持极简:接收 WebSocket 文本或二进制消息,并以相同类型原样返回。The server stays intentionally simple: it receives WebSocket text or binary messages and returns them unchanged with the same message type.

原样回显True echo

不转换格式、不修改负载,兼容 WiFi Diag 的序列号与时间戳探测。No format conversion or payload changes, compatible with WiFi Diag sequence and timestamp probes.

无状态设计Stateless by design

无需账号、Token 或数据库,不记录消息内容,部署和维护成本更低。No accounts, tokens, or database. Message content is not logged, keeping operations simple.

跨平台单文件Single-file, cross-platform

使用 Go 构建,无 CGO 依赖;下载对应架构的文件即可运行。Built with Go and no CGO dependency. Download the binary for your platform and run it.

IPv4 / IPv6IPv4 / IPv6

默认监听 [::]:8080,在常见系统上同时接受 IPv6 与 IPv4 连接。Listens on [::]:8080 by default and accepts both IPv6 and IPv4 on common systems.

支持内置 TLSBuilt-in TLS

可直接配置证书与私钥,也可通过 Caddy 或 Nginx 提供 wss://Configure a certificate and key directly, or place Caddy or Nginx in front for wss://.

健康检查Health checks

/healthz 返回简洁状态,便于容器、反向代理和监控系统检查。/healthz returns a simple status for containers, reverse proxies, and monitors.

工作方式How it works

三步建立局域网基准A LAN baseline in three steps

选择设备Choose a device

在 NAS、电脑、软路由或服务器上运行与系统架构匹配的程序。Run the matching binary on a NAS, computer, router, or server.

启动服务Start the service

默认使用 8080 端口,并在防火墙中仅向需要测试的网络开放。Use port 8080 by default and expose it only to the networks being tested.

添加到 AppAdd it to the app

在 WiFi Diag 中添加 ws://服务器IP:8080,即可开始诊断。Add ws://server-ip:8080 in WiFi Diag and start diagnosing.

下载Downloads

选择您的系统与架构Choose your system and architecture

所有程序均为独立可执行文件,无需安装 Go 或额外运行时。Every build is a standalone executable. Go and other runtimes are not required.

当前版本Current version · 1.0.1
Detecting your system…正在识别当前系统… Preparing the recommended download.正在准备推荐版本。
View all builds查看全部版本
下载后请先校验文件。Verify the file after downloading. 使用 sha256sumshasum -a 256 对照校验文件,可确认程序在传输过程中未发生变化。Compare the result of sha256sum or shasum -a 256 with the checksum file to ensure the binary was not changed in transit.

快速部署Quick start

一分钟开始回显服务Start echoing in one minute

服务默认监听所有 IPv6 地址和常见系统上的 IPv4 地址。请确保手机能够访问服务器的监听端口。The service listens on all IPv6 addresses and, on common systems, IPv4 as well. Make sure your phone can reach the listening port.

根路径 //ws 均支持 WebSocket Echo。Both / and /ws provide WebSocket echo.
可通过 -max-message-bytes-write-timeout 调整限制。Tune limits with -max-message-bytes and -write-timeout.
支持优雅退出,适合 systemd、Docker 与 NAS 容器环境。Graceful shutdown works well with systemd, Docker, and NAS containers.
二进制运行Run the binary
chmod +x ./wifidiag-echo-1.0.1-linux-amd64
./wifidiag-echo-1.0.1-linux-amd64 -addr '[::]:8080'
Docker Compose
git clone https://github.com/pinfong/echo-server.git
cd echo-server
docker compose up --build -d
内置 TLSBuilt-in TLS
./wifidiag-echo -addr '[::]:8443' \
  -tls-cert fullchain.pem -tls-key privkey.pem

开放源代码Open source

代码、构建脚本与问题追踪均在 GitHubSource, build scripts, and issues live on GitHub

您可以审阅服务端如何处理消息、自行复现多平台构建、报告问题或贡献改进。授权条款与每个版本的发布说明以 GitHub 仓库中的最新文件为准。Review how messages are handled, reproduce cross-platform builds, report issues, or contribute improvements. Licensing terms and release notes are governed by the latest files in the GitHub repository.

常见问题FAQ

部署前需要知道的事What to know before deploying

应该选择局域网还是公网 Echo Server?Should I use a LAN or public Echo Server?

局域网服务器更适合判断 Wi-Fi、AP 和本地链路质量;公网服务器测得的是包含运营商、互联网路径和远端服务器在内的端到端结果。两者可用于不同诊断目的。A LAN server better isolates Wi-Fi, access-point, and local-path quality. A public server measures the full path through your provider, the internet, and the remote host. Both are useful for different diagnostics.

服务端会保存测试数据吗?Does the server store test data?

不会。该服务不使用数据库,也不会记录 WebSocket 消息内容。常规服务日志可能包含启动、连接错误和关闭等运行信息。No. It uses no database and does not log WebSocket message contents. Operational logs may include startup, connection errors, and shutdown events.

可以直接暴露到公网吗?Can I expose it directly to the internet?

程序不提供账号或 Token 认证,并允许所有 WebSocket Origin。企业内网请用防火墙限制访问范围;公网部署建议通过 TLS 与反向代理提供 wss://,并配置适当的网络访问控制。The server has no account or token authentication and accepts all WebSocket origins. Restrict LAN access with a firewall. For public deployments, use TLS and a reverse proxy for wss:// with appropriate network access controls.

如何确认服务已经运行?How do I know the service is running?

在服务器上访问 http://127.0.0.1:8080/healthz,返回 ok 即表示服务正常。随后还需确认手机所在网络能够访问服务器 IP 和端口。Open http://127.0.0.1:8080/healthz on the server. An ok response means the process is healthy. Then confirm the phone's network can reach the server IP and port.