reverse-tunnel
reverse-tunnel copied to clipboard
Dynamic configuration
Is there any way we can change the agent config while the server is running?
Do you mean reconfiguring the server (adding agents for example) without breaking existing connections? That is not supported currently. You need to restart rtun-server to load a new config.
Yes that is exactly what I meant! Do you have any thoughts on how you'd want that implemented? I would be happy to submit a PR. This is an awesome awesome tool you've made
Thanks! PR is welcome.
I would trap SIGHUP
signal (standard-ish signal for reloading config) in the main package and reconfigure the running server with a newly loaded configuration upon signal arrival.
In the current implementation, agent configurations are passed to Action from here and are used to create tcp.Service and udp.Service objects (which handle agent auth). Luckily, these service objects are stateless, so we can replace them with new ones on the fly. I'd add Action.Update(conf)
method or something to update tcp and udp services.
I'm not sure what to do with a change of control_address
. Maybe the program should detect incompatible changes and refuse to reload a new config.
Is this ability also being implemented for the client component? I'm interested in dynamically initializing connections from the client config.