中文 English

Install Frp client on Mac and use remote desktop

Published: 2021-01-18
mac frpc frp remote desktop launchctl brew client

You can install it with Homebrew.

The following section shows the old manual extraction method. Keep reading if you want that approach.

brew install frpc
vi /usr/local/etc/frp/frpc.ini
brew services start frpc

Download the Darwin package from FRP releases and unzip it

Copy the executable

sudo mv ~/Downloads/frp_0.34.3_darwin_amd64/frpc /usr/local/bin/

Add the frpc configuration file

Edit the auto-start configuration

sudo su
cat>/etc/frpc.ini<<EOF

[common]
server_addr = blog.margrop.net
server_port = 2345
 
[VNC-Mac-TEST-CLIENT]
type = tcp
local_port = 5900
remote_port = 3333

[SSH-Mac-TEST-CLIENT]
type = tcp
local_port = 22
remote_port = 3333

EOF

Edit the auto-start plist

sudo vi /Library/LaunchDaemons/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</string>
         <string>-c</string>
         <string>/etc/frpc.ini</string>
    </array>
    <key>KeepAlive</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>
launchctl load
launchctl unload
launchctl stop
launchctl start