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

Connection dies after logging out from ssh #358

Closed shootie22 closed 2 months ago

shootie22 commented 2 months ago

Describe the bug Everything works as expected as long as I'm logged into the client machine through ssh. Once I log out, the connection dies.

To Reproduce Steps to reproduce the behavior:

  1. Create a server
  2. Create a client
  3. Make sure the connection works
  4. Log out of client ssh
  5. Wait a few seconds (~10-20s)
  6. Notice the connection died

Configuration I used the basic example. I also tried using the heartbeat and keepalive options, but to no avail.

Logs I cannot find logs, it would be nice if someone can point me into the right direction to find them.

Environment:

shootie22 commented 2 months ago

of course I realized what was wrong within minutes of creating the issue.

if you create your client as a non-root service, it will die when your session dies, a.k.a. when you log out.
I switched the service to be a system service instead of a user service and now it stays alive.