rapiz1 / rathole

A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.
Apache License 2.0
9.44k stars 475 forks source link

关于rathole,我有2个问题,想请教一下 #220

Closed aa51513 closed 1 year ago

aa51513 commented 1 year ago

①采用noise+双向认证,在服务端如何配置多个remote_public_key? 主要是想多个客户端接入同一个服务端,然后都采用noise+双向认证得方式; 还是说,目前得设计上允许多个客户端共用同一个public_key?

②采用noise+双向认证之后,我注意到客户端和服务端一共创建了18条TCP连接 哪怕没有任何数据传输,这18条TCP连接也一直存在,这个是正常的吗? 为什么是18条,这个数字是硬编码得,还是可配置的,亦或者有什么其他讲究?

还望不吝赐教,非常感谢

fernvenue commented 1 year ago

About first one: https://github.com/rapiz1/rathole/issues/205, that should answer your question. And if you really wanna use bidirectional authentication all the time, I think @ symbol in name of unit files may be a great solution, so that you can run your each server or client like this:

systemctl start rathole@a
systemctl start rathole@b
systemctl start rathole@c
....

Actually we already have examples here: https://github.com/rapiz1/rathole/tree/main/examples/systemd.

Second question, that because Rathole will pre-establish the connection with the other side, even if you have no data transmission or not using it at the moment. About the number of connections, that depends, depends on the specific situation.

By the way, you should go to discussions to ask questions, not here. Issues is for bug report and feature request.

aa51513 commented 1 year ago

Thank you very much for your reply, which solved my problem perfectly.

In addition, I realized that I made a mistake. I really shouldn't ask questions in the issue. I will go to discussions to do this in the future. I am sorry for my mistake