准备工作


必下载文件


FRP各平台客户端下载:https://github.com/fatedier/frp/releases

建议放在D盘根目录

创始人


FRP原作者:https://github.com/fatedier/frp

学习视频


视频①:https://www.bilibili.com/video/BV1tL4y1p7qA?spm_id_from=333.1007.top_right_bar_window_history.content.click

视频②:https://www.bilibili.com/video/BV1z5411E7rY?spm_id_from=333.788.top_right_bar_window_history.content.click

视频①作者笔记


首先感谢原作者以及一键脚本作者的成果,附上相关原始页面,大家可去看看,以下为摘取的关键命令,方便新手朋友复制安装!
FRP原作者页面:https://github.com/fatedier/frp
KoolShare-FRP一键脚本:https://github.com/clangcn/onekey-install-shell
脚本适用于安装平台:CentOS、Debian、Ubuntu~
FRP服务端一键安装脚本:

wget --no-check-certificate https://raw.githubusercontent.com/clangcn/onekey-install-shell/master/frps/install-frps.sh -O ./install-frps.sh
chmod 700 ./install-frps.sh
./install-frps.sh install

卸载命令:
./install-frps.sh uninstall

更新FRP命令:
./install-frps.sh update

FRP常用命令:
开启FRP
frps start

停止FRP:
Frps stop

重启FRP
frps restart

客户端FRPC配置文本:

[common]
server_addr = nas.frpxx.com # 服务器IP或者地址
server_port = 7000 # 服务器提供的端口号
token = dgegiiVu # 服务器提供的token

[web1_xxxxx] # 为避免错误,一定需更改为比较特殊的名称,不能和服务器端其他配置重名.或者默认xxxxxx
type = http # http协议
local_ip = 192.168.1.5 # 填写群晖内网IP.
local_port = 5000 # 群晖内网HTTP端口,默认为5000.
custom_domains = nas.ioiox.com # 填写你解析到服务器的域名

[web2_xxxxxx] # 为避免错误,一定需更改为比较特殊的名称,不能和服务器端其他配置重名.
type = https # https协议
local_ip = 192.168.1.5 # 填写群晖内网IP.
local_port = 5001 # 群晖内网HTTPS端口,默认为5001.
custom_domains = nas.frpsxx.com # 填写你解析到服务器的域名

FRP服务端


CentOS、Debian、Ubuntu可以用FRP服务端一键安装脚本(windows服务器的话看视频二,和客户端配置差不多)。

下载frp


wget --no-check-certificate https://raw.githubusercontent.com/clangcn/onekey-install-shell/master/frps/install-frps.sh -O ./install-frps.sh
chmod 700 ./install-frps.sh
./install-frps.sh install

一路默认回车,傻瓜式安装即可,唯一就是第二行http端口设置需要换个端口。

配置完成


最后出现这个,服务端就配置完成了,可以通过user和password登录frps Dashboard的网页看一些连接数据。

FRP客户端


下载frp


下载这个文件来配置客户端,主要用到frpc.exe和frpc.ini,frpc.bat是一个脚本文件(自建的用来快捷执行命令)。

FRP各平台客户端下载:https://github.com/fatedier/frp/releases

编写frpc.ini配置文件


token是客户端连接服务端的秘钥。

[common]
server_addr = frp.ywhao.bitworkshop.cn
server_port = 5443
token = 123456

[myweb-http]
type = http
local_ip = 127.0.0.1
local_port = 8081
custom_domains = web.ywhao.bitworkshop.cn

编写.bat脚本文件


@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0""h",0)(window.close)&&exit
:begin
REM
D:
cd frp
frpc.exe -c frpc.ini

至此客户端也配置完成,点击.bat文件即可开启内网穿透。

设置更多服务,只需配置frpc.ini文件即可。