fatedier / frp

A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
Apache License 2.0
86.17k stars 13.33k forks source link

[Feature Request] Live Reload #4340

Closed SevensRequiem closed 2 months ago

SevensRequiem commented 3 months ago

Describe the feature request

I run UDP/TCP apps behind FRP, and I often have to reload the entire FRPC when adding new clients, as such any connections to the server get reset, it would be beneficial if I could just save the config and have frpc detect and add the added proxies, or remove if removed.

Describe alternatives you've considered

No response

Affected area

xqzr commented 3 months ago

https://github.com/fatedier/frp?tab=readme-ov-file#hot-reloading-frpc-configuration

SevensRequiem commented 3 months ago

https://github.com/fatedier/frp?tab=readme-ov-file#hot-reloading-frpc-configuration

I tried that, it just returns

Jul 15 16:06:08 amp1 frpc[128019]: Get "http://127.0.0.1:7400/api/reload?strictConfig=true": dial tcp 127.0.0.1:7400: connect: connection refused
Jul 15 16:06:08 amp1 systemd[1]: frpc.service: Main process exited, code=exited, status=1/FAILURE
Jul 15 16:06:08 amp1 systemd[1]: frpc.service: Failed with result 'exit-code'.
Jul 15 16:06:14 amp1 systemd[1]: frpc.service: Scheduled restart job, restart counter is at 99.
Jul 15 16:06:14 amp1 systemd[1]: Stopped frpc.service - frp client.
xqzr commented 3 months ago

https://github.com/fatedier/frp?tab=readme-ov-file#hot-reloading-frpc-configuration

I tried that, it just returns

Jul 15 16:06:08 amp1 frpc[128019]: Get "http://127.0.0.1:7400/api/reload?strictConfig=true": dial tcp 127.0.0.1:7400: connect: connection refused
Jul 15 16:06:08 amp1 systemd[1]: frpc.service: Main process exited, code=exited, status=1/FAILURE
Jul 15 16:06:08 amp1 systemd[1]: frpc.service: Failed with result 'exit-code'.
Jul 15 16:06:14 amp1 systemd[1]: frpc.service: Scheduled restart job, restart counter is at 99.
Jul 15 16:06:14 amp1 systemd[1]: Stopped frpc.service - frp client.

https://github.com/fatedier/frp/blob/b4d5d8c756bfa7c5f4fc73c3dff48678d0110fce/conf/frpc_full_example.toml#L53-L55

SevensRequiem commented 3 months ago
serverAddr = "x.x.x.x"
serverPort = 7000
transport.protocol = "quic"
auth.method = "token"
auth.token = "xxxx"
transport.dialServerKeepalive = 7200
transport.heartbeatInterval = 30
transport.heartbeatTimeout = 90
webServer.addr = "127.0.0.1"
webServer.port = 7400

Is my current config

github-actions[bot] commented 3 months ago

Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.