Last active
August 30, 2024 02:49
-
-
Save imyelo/b6c3d3d9383f7d5623f06a0c11052530 to your computer and use it in GitHub Desktop.
run frp client as a service on windows and ubuntu / debian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. put frpc and frpc.ini under /usr/local/frpc/ | |
# 2. put this file (frpc.service) at /etc/systemd/system | |
# 3. run `sudo systemctl daemon-reload && sudo systemctl enable frpc && sudo systemctl start frpc` | |
# Then we can manage frpc with `sudo service frpc {start|stop|restart|status}` | |
# See also: https://nosame.net/use-frp-to-reverse-proxy-your-nas/ | |
# Alternative for server: | |
# - Offical: https://github.com/fatedier/frp/blob/a4cfab6/conf/systemd/frpc%40.service | |
[Unit] | |
Description=frp client | |
Wants=network-online.target | |
After=network.target network-online.target | |
[Service] | |
ExecStart=/usr/local/frpc/frpc -c /usr/local/frpc/frpc.ini | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: 1. download [nssm](https://github.com/kirillkovalenko/nssm) and set its diretory into the global PATH environment value | |
: 2. replace the path below with where you placed frpc | |
nssm install frpc "D:\Tools\frpc\frpc.exe" "-c D:\Tools\frpc\frpc.ini" | |
nssm set frpc DisplayName "frp client" | |
nssm start frpc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nssm stop frpc | |
nssm remove frpc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment