官方发现发布 0.52.0 版本后,取消了原有 ini配置文件,改为toml新格式。
配置文件部分参数值发生了改变,且格式与原来有很大的改变,在此分享一些参考配置,供需要的小伙伴们使用,这个配置非常简单,需要更多复杂配置需要参考官方文档。文章源自合一学院-https://unvmax.com/%e6%96%b0%e7%89%88%e6%9c%acfrp-for-docker%e5%8f%82%e8%80%83%e9%85%8d%e7%bd%ae%e5%88%86%e4%ba%ab.html
先决条件:1.拥有一个VPS服务器;2.本地可以运行docker;服务端和客服端需要用到的端口要打开。文章源自合一学院-https://unvmax.com/%e6%96%b0%e7%89%88%e6%9c%acfrp-for-docker%e5%8f%82%e8%80%83%e9%85%8d%e7%bd%ae%e5%88%86%e4%ba%ab.html
一、服务端配置
1.服务端配置文件创建和修改
mkdir /etc/frp&&vim /etc/frp/frps.toml
修改内容如下:文章源自合一学院-https://unvmax.com/%e6%96%b0%e7%89%88%e6%9c%acfrp-for-docker%e5%8f%82%e8%80%83%e9%85%8d%e7%bd%ae%e5%88%86%e4%ba%ab.html
bindAddr = "0.0.0.0" bindPort = 7000 auth.method = "token" auth.token = "12345678"
2.服务端终端运行docker命令
docker run --restart=always --network host -d -v /etc/frp/frps.toml:/etc/frp/frps.toml --name frps snowdreamtech/frps
服务端配置完成!文章源自合一学院-https://unvmax.com/%e6%96%b0%e7%89%88%e6%9c%acfrp-for-docker%e5%8f%82%e8%80%83%e9%85%8d%e7%bd%ae%e5%88%86%e4%ba%ab.html
二、客户端配置流程
1.客户端配置文件创建和修改
mkdir /etc/frp&&vim /etc/frp/frpc.toml
按照需要修改自己的内容(内容仅供参考):文章源自合一学院-https://unvmax.com/%e6%96%b0%e7%89%88%e6%9c%acfrp-for-docker%e5%8f%82%e8%80%83%e9%85%8d%e7%bd%ae%e5%88%86%e4%ba%ab.html
x.x.x.x 是frps服务端的的公网IP文章源自合一学院-https://unvmax.com/%e6%96%b0%e7%89%88%e6%9c%acfrp-for-docker%e5%8f%82%e8%80%83%e9%85%8d%e7%bd%ae%e5%88%86%e4%ba%ab.html
serverAddr = "x.x.x.x" serverPort = 7000 auth.method = "token" auth.token = "12345678" [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 remotePort = 222 [[proxies]] name = "BT" type = "tcp" localIP = "127.0.0.1" localPort = 13148 remotePort = 13149 [[proxies]] name = "docker" type = "tcp" localIP = "127.0.0.1" localPort = 8081 remotePort = 8088 [[proxies]] name = "nextcloud" type = "tcp" localIP = "127.0.0.1" localPort = 8 remotePort = 8
2.客户端终端运行docker命令
docker run --restart=always --network host -d -v /etc/frp/frpc.toml:/etc/frp/frpc.toml --name frpc snowdreamtech/frpc文章源自合一学院-https://unvmax.com/%e6%96%b0%e7%89%88%e6%9c%acfrp-for-docker%e5%8f%82%e8%80%83%e9%85%8d%e7%bd%ae%e5%88%86%e4%ba%ab.html文章源自合一学院-https://unvmax.com/%e6%96%b0%e7%89%88%e6%9c%acfrp-for-docker%e5%8f%82%e8%80%83%e9%85%8d%e7%bd%ae%e5%88%86%e4%ba%ab.html