2021年9月

What is frp?

rp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports TCP and UDP, as well as HTTP and HTTPS protocols, where requests can be forwarded to internal services by domain name.
frp also has a P2P connect mode.

github.com:frp

架构

FRP分为服务端frps和客户端frpc。架构如下:

设置服务端systemd service, /etc/systemd/system/frps.service:

[Unit]
Description=Frp Server Service
After=network.target

[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frps -c /etc/frp/frps.ini
LimitNOFILE=1048576

[Install]
WantedBy=multi-user.target

服务端设置好后:

Congratulations, frps install completed!
==============================================
You Server IP   : 123.123.123.123
Bind port       : 7020
Dashboard port  : 7500
vhost http port : 7080
vhost https port: 7443
Privilege token : tokenxxxxx!
Max Pool count  : 50
Log level       : info
Log max days    : 3
Log file        : enable

客户端 frpc.ini:

[common]
server_addr = 123.123.123.123
server_port = 7020

[web]
type = http
local_port = 80
custom_domains = frp.domain.com