# 命令行测速

[校园网测速站](http://speed.nju.edu.cn)支持命令行工具测速，以方便没有图形界面的广大用户。

## 下载CLI客户端

各平台下载方式见<https://github.com/librespeed/speedtest-cli>。

为了方便下载，南京大学开源镜像站亦有镜像：[speedtest-cli 南大镜像](https://mirror.nju.edu.cn/download/speedtest-cli)

## 使用方法

IPv4站点：
```
./librespeed-cli --server-json http://speed.nju.edu.cn/cli.json --server 1
```

IPv6站点：
```
./librespeed-cli --server-json http://speed6.nju.edu.cn/cli.json --server 2
```

如果希望开启遥测功能（可以看见ISP等详细信息，数据也会被记录在服务器），增加此参数：`--telemetry-level full`。使用遥测功能视为同意`speed.nju.edu.cn`主页的隐私政策。

## 常见问题

### XShell 刷新异常，出现“WWWWW”乱码

此现象与当前使用的 Shell 有关，例如下图为 XShell 软件出现的情况。

[![](https://doc.nju.edu.cn/uploads/images/gallery/2023-01/scaled-1680-/image-1673354465545.png)](https://doc.nju.edu.cn/uploads/images/gallery/2023-01/image-1673354465545.png)

如果用户是在 XShell 中出现此问题，在**会话属性-终端-VT模式**中关闭 **"Auto Wrap Mode"**，即可解决。

[![](https://doc.nju.edu.cn/uploads/images/gallery/2023-01/scaled-1680-/image-1673354647911.png)](https://doc.nju.edu.cn/uploads/images/gallery/2023-01/image-1673354647911.png)

其他类似软件可能有类似设置。

### 测试结果带宽小于0

测速结果出现小于0的带宽。

[![](https://doc.nju.edu.cn/uploads/images/gallery/2023-01/scaled-1680-/image-1673354747748.png)](https://doc.nju.edu.cn/uploads/images/gallery/2023-01/image-1673354747748.png)

出现此情况主要原因可能是数据溢出。请检查是否运行或编译了32位的程序，在网速较快且使用32位程序时，容易发生此问题。