mobile wallpaper 1mobile wallpaper 2mobile wallpaper 3mobile wallpaper 4mobile wallpaper 5mobile wallpaper 6
412 字
1 分钟
zju-connect 代替 aTrust 客户端
2026-02-22

背景#

继上一次 解决毒瘤深信服easyconnect,校方随大流已将 VPN 升级为深信服的 aTrust。当然,🐶改不了吃💩,软件换皮不能改变其强兼你电脑的本质。好在互联网冲浪时发现浙江大学的同学提供了 ZJU RVPN 客户端的 Go 语言实现,经实测其可完全使用与常规 aTrust VPN 的使用场景。

下载#

下载 zju-connect 的 beta 或者 nightly 版本。由于是独立二进制文件,因此解压后即可使用。如果是生产环境上需要,也可以考虑 Docker 部署。

配置文件#

zju-connect 以 toml 作为配置文件,配置字段可参考 参数说明。下面给出一个基本配置文件:

protocol = "atrust"
# 修改为学校的 vpn 地址
server_address = "vpn.nmu.edu.cn"
server_port = 443
username = "账号"
password = "密码"
# 代理端口
socks_bind = ":1090"
http_bind = ":1091"
# 非浙大人员请将以下两项置为 true 以避免冲突
disable_zju_config = true
disable_zju_dns = true
dns_ttl = 3600
disable_keep_alive = false
zju_dns_server = "auto"
secondary_dns_server = "114.114.114.114"
debug_dump = false
port_forwarding = []
custom_dns = []
# aTrust 设置
auth_type = "auth/psw"
login_domain = "BMD"
client_data_file = "client_data.json"
graph_code_file = "graph_code.jpg"
update_best_nodes_interval = 300

关于上述配置文件中的 aTrust 设置,需要根据实际情况进行配置。具体来说,当启动 zju-connect 后,终端显示如下:

❯ .\zju-connect.exe -config .\config.toml
2026/02/22 09:58:02 Start ZJU Connect v1.0.0-beta.4-b593140
2026/02/22 09:58:02 Read client data file error: open client_data.json: The system cannot find the file specified.
2026/02/22 09:58:02 Will create a new client data file if log in successfully
2026/02/22 09:58:02 VPN protocol: atrust
2026/02/22 09:58:02 Perform GET /passport/v1/public/authConfig
# --------------注意这一行-----------------
2026/02/22 09:58:02 Available authentication methods: [{LoginDomain:BMD AuthType:auth/psw AuthName:师生用户 LoginURL:} {LoginDomain:local AuthType:auth/psw AuthName:非师生用户 LoginURL:}]
# ------------------------------
2026/02/22 09:58:02 Login error: auth type/login domain combination not found: auth type: auth/psw, login domain: Radius
2026/02/22 09:58:02 VPN client setup error: auth type/login domain combination not found: auth type: auth/psw, login domain: Radius

首次启动失败后的日志中会显示 Available authentication methods,将其中的 LoginDomainAuthType 分别对应地写入 toml 配置文件中即可。然后重新启动 zju-connect 即可。

代理配置#

NOTE

此处以 clash 系列为例,v2ray 等其他代理内核的原理一致。

根据上述配置文件中设置的代理端口,需要给 clash 添加新的代理节点、策略组和分流规则。

# 代理端口
socks_bind = ":1090"
http_bind = ":1091"

clash 配置文件变动如下:

# 注意: 新增的分流规则添加在顶部
rules:
# vpn 地址保持直连
- DOMAIN,vpn.nmu.edu.cn,🎯 全球直连
# 内网域名和IP段走策略组
- DOMAIN-SUFFIX,nmu.edu.cn,🏫 校园网
- IP-CIDR,10.0.0.0/8,🏫 校园网,no-resolve
- IP-CIDR,172.16.0.0/12,🏫 校园网,no-resolve
proxies:
- name: zju-local
type: socks5
server: 127.0.0.1
port: 1090
udp: true
proxy-groups:
- type: select
name: 🏫 校园网
proxies:
- 🚀 节点选择
- 🎯 全球直连
- zju-local
- DIRECT
# 学术科研的策略组根据实际情况添加
# 我这里是因为对文献库做了分流
- type: select
name: 📚 学术科研
proxies:
- 🚀 节点选择
- 🎯 全球直连
- 🏫 校园网
- DIRECT
WARNING

出于特殊原因,我无需使用脚本完成配置文件修改,因此本文不提供 clash 桌面端的脚本。

分享

如果这篇文章对你有帮助,欢迎分享给更多人!

zju-connect 代替 aTrust 客户端
https://blog.085404.xyz/posts/zju-connect-代替-atrust-客户端/
作者
sun2ot
发布于
2026-02-22
许可协议
CC BY-NC-SA 4.0

部分信息可能已经过时

封面
Sample Song
Sample Artist
封面
Sample Song
Sample Artist
0:00 / 0:00