FRP is a fast reverse proxy solution designed to make local servers, which are otherwise obscured by NAT or firewalls, accessible over the Internet. It facilitates support for both TCP and UDP, along with HTTP and HTTPS protocols, thus allowing domain name-based requests to be directed towards internal services.
Worrying about not having a static IPv4 address for your home servers? Fatedier's FRP project might just be the right solution.
"Systemd serves as a foundational collection of components for a Linux system, offering a manager for both system and services that operates with the initial process identifier, PID 1, and initiates the launch sequence for the system's remaining elements."
This is used to manage the launch/autostart/reload/shutdown/etc. procedures of the FRPS Service. If you don't need such things, skip this section.
# Install systemd through yum(CentOS/RHEL)
yum install systemd
# Install systemd through apt(Debian/Ubuntu)
apt install systemd
3. Create the frps.service File (Co-optional with 2)
Use a text editor (such as vim) to create a file named frps.service in the /etc/systemd/system directory, for configuring the frps service.
Write the following content into it:
[Unit]
# Customisable Service Name
Description = frp server
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
# The lauching command, need to modify it to the installation path of your frps.
ExecStart = /path/to/frps -c /path/to/frps.toml
[Install]
WantedBy = multi-user.target
4. Modify the frps.toml File
# Change it to whatever you like, and open up the port in server firewall settings.
bindPort = 7000
# Add the following lines if you need a web UI for FRPS; Default is 127.0.0.1; for public access, change to 0.0.0.0;
webServer.addr = "0.0.0.0"
webServer.port = 7001
# Dashboard username and password, optional
webServer.user = "username"
webServer.password = "password"
# Add the following lines if you need an authentication between Clients and the Server
auth.method = "token"
auth.token = "password"
The FRPS Web UI
Start the Service
1. Using Systemd
# Manage FRPS service with systemd commands:
# Start FRPS
sudo systemctl start frps
# Stop FRPS
sudo systemctl stop frps
# Restart FRPS
sudo systemctl restart frps
# Check FRPS Status
sudo systemctl status frps
# To set FRPS to start automatically at boot, use:
sudo systemctl enable frps
2. Not Using Systemd
# cd to the FRPS directory
./frps -c ./frps.toml
Configure the frpc.toml file on Clients' End
serverAddr = "x.x.x.x"
# Communication port for FRP with the server, need to be consistent with the port settings in server's configuration file.
serverPort = 7000
# (Optional) Enter the same password as on the server side
auth.method = "token"
auth.token = "password"
# (Optional) Web Console
webServer.addr = "127.0.0.1"
webServer.port = 7400
webServer.user = "admin"
webServer.password = "admin"
[[proxies]]
name = "tcp"
# Protocal, refer to the github page for more info.
type = "tcp"
# Local IP (the IP to be reverse proxied)
localIP = "127.0.0.1"
localPort = xxxx
# Accessing the following port on the server side will forward traffic to the local IP port above:
remotePort = xxxx
For your reference, check out the following templates:
Comments | NOTHING