反向代理应用:frp
# frp文档:
https://gofrp.org/zh-cn/# 说明:
为防止云服务器提示"检测到存在恶意文件"等安全警告,以下操作仅在Docker环境进行测试# 恶意文件处理帮助与常见问题:
https://cloud.tencent.com/document/product/296/111880# 基础安全服务:
https://help.aliyun.com/zh/ecs/user-guide/basic-security-services
1、安装Docker
合集:Docker安装与使用
2、安装frp
详见:https://gofrp.org/zh-cn/docs/setup/
运行容器:
docker run -it -d --name alpine -p 6000:6000 alpine
查看容器列表:
docker ps
查看IP:
# 查看网关(假设Gateway为172.17.0.1):
docker inspect alpine | grep Gateway# 查看容器IP(假设IPAddress为172.17.0.2):
docker inspect alpine | grep IPAddress# 查看宿主机IP(包含公网IP、与alpine容器同网段的IP等)
ip addr
进入容器:
# 进入容器:
docker exec -it alpine sh
# ----------------------------------------
"一、下载、解压"
# ----------------------------------------# 1、切换目录
cd /root# 2、下载
wget https://github.com/fatedier/frp/releases/download/v0.64.0/frp_0.64.0_linux_amd64.tar.gz# 3、解压
tar -xf frp_0.64.0_linux_amd64.tar.gz# ----------------------------------------
"二、查看目录、文件"
# ----------------------------------------# 4、查看目录
frp_0.64.0_linux_amd64
├── LICENSE
├── frpc
├── frpc.toml
├── frps
└── frps.toml0 directories, 5 files# 5、切换目录
cd frp_0.64.0_linux_amd64/# 6、查看frps.toml文件
bindPort = 7000# 7、查看frpc.toml文件
serverAddr = "127.0.0.1"
serverPort = 7000[[proxies]]
name = "test-tcp"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 6000# ----------------------------------------
"三、简单使用"
# ----------------------------------------# 8、查看帮助
./frps --help
./frpc --help# 9、启动服务端
./frps -c ./frps.toml &# 10、启动客户端
./frpc -c ./frpc.toml &# 11、查看进程列表
ps# 12、进程列表内容
PID USER TIME COMMAND1 root 0:00 /bin/sh7 root 0:00 sh17 root 0:00 ./frps -c ./frps.toml22 root 0:00 ./frpc -c ./frpc.toml26 root 0:00 ps# 13、结束进程
kill 进程PID
# 退出容器
exit
停止容器:
docker stop alpine
删除容器:
docker rm alpine
删除镜像:
docker rmi alpine
3、官方文档提供的示例
详见;
https://gofrp.org/zh-cn/
https://gofrp.org/zh-cn/docs/setup/
https://gofrp.org/zh-cn/docs/examples/
https://gofrp.org/zh-cn/docs/features/
https://gofrp.org/zh-cn/docs/reference/
4、详见
https://gofrp.org/zh-cn/
https://gofrp.org/zh-cn/docs/
https://github.com/fatedier/frp
https://github.com/fatedier/frp/blob/dev/README.md
https://github.com/fatedier/frp/blob/dev/README_zh.md
https://mp.weixin.qq.com/s/kd1_ZJyzIgepqe_LDarCzw