Mythologyli / zju-connect

ZJU RVPN 客户端的 Go 语言实现
GNU Affero General Public License v3.0
313 stars 20 forks source link

[BUG] ParseServConfig must be true #7

Closed cxz66666 closed 1 year ago

cxz66666 commented 1 year ago

I try to set disable-server-config to true, but get fatal at core.QueryIp:L108

runtime/debug.Stack()
        C:/Program Files/Go/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
        C:/Program Files/Go/src/runtime/debug/stack.go:16 +0x19
github.com/mythologyli/zju-connect/core.QueryIp({0xc00003a460?, 0x2?}, 0xc00002ed80, 0x0)
        C:/Users/ChenXuzheng/Desktop/ZJU-Connect/core/protocol.go:108 +0x258
github.com/mythologyli/zju-connect/core.(*EasyConnectClient).GetClientIp(0xc000330080)
        C:/Users/ChenXuzheng/Desktop/ZJU-Connect/core/EasyConnectClient.go:219 +0x38
github.com/mythologyli/zju-connect/core.StartClient({0xc0002988c0?, 0x3?}, 0x0?, {0x11841d3, 0xa}, {0x1186d0c, 0xc}, {0x0, 0x0})
        C:/Users/ChenXuzheng/Desktop/ZJU-Connect/core/EasyConnectClient.go:122 +0x652
github.com/mythologyli/zju-connect/core.StartClient({0x1189bda?, 0xc0000881f0?}, 0xc0001c0150?, {0x11841d3, 0xa}, {0x1186d0c, 0xc}, {0x0, 0x0})
        C:/Users/ChenXuzheng/Desktop/ZJU-Connect/core/EasyConnectClient.go:110 +0x5db
main.main()
        C:/Users/ChenXuzheng/Desktop/ZJU-Connect/main.go:103 +0xd65
2023/02/07 18:12:29 unexpected query ip reply

After checking the code logic, I found the reason is DOESN'T do a request to /por/rclist.csp

So there are two solutions:

Mythologyli commented 1 year ago

使用 main 分支的最新代码无法复现此错误。

运行平台 Windows 11 x64,参数为 -username xxx -password xxx -disable-server-config。程序正常运行。

ParseResourceLists 函数的此行

res, ok := ParseXml(&ResourceList, host, config.PathRlist, twfID)

设置断点,断点未触发,说明没有执行对 /por/rclist.csp 的请求。

cxz66666 commented 1 year ago

补充问题: 网络环境为玉泉有线网,rvpn.zju.edu.cn解析出ip为10.3.1.170,可以复现出此问题,尝试切换热点,rvpn.zju.edu.cn解析ip为61.175.193.50,未复现此问题,或许是校方内网与公网部署的服务端有差异导致

cxz66666 commented 1 year ago

补充问题: 经测试,ZJUWLAN、手机热点均可正常设置server为10.3.1.170, 218.108.88.254, 61.175.193.50,但有线连接三者均出现上述问题,暂时判断为本地有线/校园有线网设置问题,不影响整体的使用,关闭问题