原样回显True echo
不转换格式、不修改负载,兼容 WiFi Diag 的序列号与时间戳探测。No format conversion or payload changes, compatible with WiFi Diag sequence and timestamp probes.
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,健康检查路径为 /healthz。Supports / and /ws; health checks are available at /healthz.
$ ./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
软件介绍Overview
服务端保持极简:接收 WebSocket 文本或二进制消息,并以相同类型原样返回。The server stays intentionally simple: it receives WebSocket text or binary messages and returns them unchanged with the same message type.
不转换格式、不修改负载,兼容 WiFi Diag 的序列号与时间戳探测。No format conversion or payload changes, compatible with WiFi Diag sequence and timestamp probes.
无需账号、Token 或数据库,不记录消息内容,部署和维护成本更低。No accounts, tokens, or database. Message content is not logged, keeping operations simple.
使用 Go 构建,无 CGO 依赖;下载对应架构的文件即可运行。Built with Go and no CGO dependency. Download the binary for your platform and run it.
默认监听 [::]:8080,在常见系统上同时接受 IPv6 与 IPv4 连接。Listens on [::]:8080 by default and accepts both IPv6 and IPv4 on common systems.
可直接配置证书与私钥,也可通过 Caddy 或 Nginx 提供 wss://。Configure a certificate and key directly, or place Caddy or Nginx in front for wss://.
/healthz 返回简洁状态,便于容器、反向代理和监控系统检查。/healthz returns a simple status for containers, reverse proxies, and monitors.
工作方式How it works
在 NAS、电脑、软路由或服务器上运行与系统架构匹配的程序。Run the matching binary on a NAS, computer, router, or server.
默认使用 8080 端口,并在防火墙中仅向需要测试的网络开放。Use port 8080 by default and expose it only to the networks being tested.
在 WiFi Diag 中添加 ws://服务器IP:8080,即可开始诊断。Add ws://server-ip:8080 in WiFi Diag and start diagnosing.
命令行程序Command-line binary
服务器、NAS 与软路由Servers, NAS, and routers
独立 EXE 文件Standalone EXE
sha256sum 或 shasum -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
服务默认监听所有 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.chmod +x ./wifidiag-echo-1.0.1-linux-amd64
./wifidiag-echo-1.0.1-linux-amd64 -addr '[::]:8080'
git clone https://github.com/pinfong/echo-server.git
cd echo-server
docker compose up --build -d
./wifidiag-echo -addr '[::]:8443' \
-tls-cert fullchain.pem -tls-key privkey.pem
开放源代码Open source
您可以审阅服务端如何处理消息、自行复现多平台构建、报告问题或贡献改进。授权条款与每个版本的发布说明以 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
局域网服务器更适合判断 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.
不会。该服务不使用数据库,也不会记录 WebSocket 消息内容。常规服务日志可能包含启动、连接错误和关闭等运行信息。No. It uses no database and does not log WebSocket message contents. Operational logs may include startup, connection errors, and shutdown events.
程序不提供账号或 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.
在服务器上访问 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.