Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议在客户端也支持上新增隧道时,不指定服务端口时,将自动生成端口号 #144

Open
fall-nebula opened this issue Jan 12, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@fall-nebula
Copy link

一个新注册的客户端,若使用配置文件启动,配置文件中若填写了tcp隧道,则在启动时会自动将TCP隧道注册到服务端中,非常方便。

[tcp]
mode=tcp
target_addr=127.0.0.1:80
server_port=10000

见服务端中已在2022-12-19优化了“新增隧道时,不指定服务端口时,将自动生成端口号”,希望上述的客户端注册方式也支持不传server_port或传入0值可自动分配服务端可用的端口号。
image

目前若客户端配置文件不传server_port或传0会报The server returned an error, which port or host may have been occupied or not allowed to open.
image

望有大佬采纳此建议,会对客户端数量较多的场景有很大帮助,提前感谢各位开源大佬。

@fall-nebula fall-nebula added the enhancement New feature or request label Jan 12, 2024
@fall-nebula
Copy link
Author

fall-nebula commented Jan 12, 2024

由于本人不是很熟悉Golang还在尝试阅读源码,刚拉取代码也未能成功配对开发环境,因此先提出issue看能否有大佬能提供帮助呢。
image
image
image
但似乎ehang.io并未提供相关依赖包?
image
也尝试了不同的go代理,得到的打印相似unrecognized import path "ehang.io": parse https://ehang.io/?go-get=1: no go-import meta tags ()
image

@fall-nebula
Copy link
Author

fall-nebula commented Jan 12, 2024

浅读到生成端口号的代码是yisier大佬提交的代码
image
但由于不熟悉go语言还未读懂,客户端在SendInfoGetAddStatus,由服务端的哪里处理返回的端口不可用呢?
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant