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
8.8k stars 440 forks source link

Tunnel failure and Interruption when adding a new port #354

Open AnteL-1366 opened 2 months ago

AnteL-1366 commented 2 months ago

The tunnel fails when a new port is added while the tunnel is established and a large number of ports are exchanging information between the two servers in the tunnel. In such a way that I have to close the tunnel on both the server and client sides and restart it again to works again

server side :

server.toml [server] bind_addr = "0.0.0.0:xxxx" # xxxx specifies the port that rathole listens for clients

[server.services.my_123] token = "**" Token that is used to authenticate the client for the service. Change to a arbitrary value. bind_addr = "0.0.0.0:4321" # '4321' specifies the port that exposes my_nas_ssh to the Internet

client side :

client.toml [client] remote_addr = "x.x.x.x:xxxx" # Server 1 address of the server. The port must be the same

[client.services.my_123] token = "**" Must be the same with the server to pass the validation local_addr = "1.2.3.4:4321" # The address of the service that needs to be forwarded

is there any config or suggestion to add to server and client side to solve the problem ?

AnteL-1366 commented 2 months ago

this is the log after tunnel break, it breaks when i add new port in toml or restart the rathole

Apr 21 21:00:01 --Helsinki-02 root: 2024-04-21T17:30:01.958316Z WARN handle{service=34280}:run: rathole::client: Failed to run the data channel: Failed to read cmd: early eof Apr 21 21:00:01 --Helsinki-02 root: 2024-04-21T17:30:01.958443Z WARN handle{service=34271}:run: rathole::client: Failed to run the data channel: Failed to read cmd: early eof Apr 21 21:00:01 --Helsinki-02 root: 2024-04-21T17:30:01.958532Z WARN handle{service=34258}:run: rathole::client: Failed to run the data channel: Failed to read cmd: early eof

Apr 21 21:00:02 --Helsinki-02 root: 2024-04-21T17:30:02.853198Z ERROR handle{service=34244}: rathole::client: Failed to run the control channel: Failed to read cmd: early eof. Retry in 529.0> Apr 21 21:00:02 --Helsinki-02 root: 2024-04-21T17:30:02.853919Z ERROR handle{service=34249}: rathole::client: Failed to run the control channel: Failed to read cmd: early eof. Retry in 561.5> Apr 21 21:00:02 --Helsinki-02 root: 2024-04-21T17:30:02.854001Z ERROR handle{service=34135}: rathole::client: Failed to run the control channel: Failed to read cmd: early eof. Retry in 543.3>