混合云
这份快速指南将引导你如何使用FRP做POC。
FRP服务端
frps.toml
1[common]
2bind_port = 7000
3vhost_http_port = 8080
4vhost_https_port = 8081
5log_file = console
6dashboard_port = 7500
7dashboard_user = fewbox
8dashboard_pwd = {your password}
9token = {your token}
10custom_404_page = /root/frps/404.html
service
1vi /etc/systemd/system/frps.service
frps.service
1[Unit]
2Description = frp server
3After = network.target syslog.target
4Wants = network.target
5[Service]
6Type = simple
7ExecStart = /root/frps/frps -c /root/frps/frps.toml
8
9[Install]
10WantedBy = multi-user.target
systemctl
1systemctl enable frps
2systemctl start frps
3systemctl status frps
404.html
1<!DOCTYPE html>
2<head>
3 <title>404</title>
4 <style>
5 .container {
6 display: flex;
7 flex-direction: column;
8 justify-content: center;
9 align-items: center;
10 height: 100vh;
11 }
12 .box {
13 margin: 5px;
14 text-align: center;
15 }
16 .box svg {
17 width: 40em;
18 }
19 .box p {
20 color: #251462;
21 font-size: 2em;
22 }
23 </style>
24</head>
25<body>
26 <div class="container">
27 <div class="box">
28 <!--SVG-->
29 </div>
30 <div class="box">
31 <p>404...</p>
32 </div>
33 </div>
34</body>
35</html>
FRP客户端
frpc.toml
1[common]
2server_addr = 13.91.106.222
3server_port = 7000
4token = {your token}
5
6[web]
7type = http
8local_ip = 192.168.1.118
9local_port = 80
10custom_domains = *.{domain}.com,*.{domain}.ai
service
1vi /etc/systemd/system/frpc.service
frpc.service
1[Unit]
2Description = frp client
3After = network.target syslog.target
4Wants = network.target
5
6[Service]
7Type = simple
8ExecStart = /root/frp/frpc -c /root/frp/frpc.toml
9
10[Install]
11WantedBy = multi-user.target
systemctl
1systemctl enable frpc
2systemctl start frpc
3systemctl status frpc