下载
https://github.com/fatedier/frp/releases/download/v0.35.0/frp_0.35.0_darwin_amd64.tar.gz
配置
tar xvf frp_0.35.0_darwin_amd64.tar.gz
sudo mv frp_0.35.0_darwin_amd64 /usr/local/
cd /usr/local/
sudo mv frp_0.35.0_darwin_amd64 frp
修改 frp 配置
......... 略
配置开机启动
vim ~/Library/LaunchAgents/frpc.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN
http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
<key>Label</key>
<string>frpc</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/frpc/frpc</string>
<string>-c</string>
<string>/usr/local/bin/frpc/frpc.ini</string>
</array>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
# 加载生效
sudo chown root ~/Library/LaunchAgents/frpc.plist
sudo launchctl load -w ~/Library/LaunchAgents/frpc.plist
brew 安装
brew install frpc
To restart frpc after an upgrade:
brew services restart frpc
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/frpc/bin/frpc -c /opt/homebrew/etc/frp/frpc.ini
==> Summary
🍺 /opt/homebrew/Cellar/frpc/0.44.0: 9 files, 10.8MB
==> Running `brew cleanup frpc`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).