这里只讲客户端操作,服务器端可以看我之前的说明
Docker地址
https://hub.docker.com/r/stilleshan/frpc
拉取命令(用docker-compose的话,就可以不用这个)
docker pull stilleshan/frpc
需要两个配置文件,以下示例均在 /root/docker/frpc/ 下操作
这里下载
https://raw.githubusercontent.com/stilleshan/frpc/refs/heads/master/frpc.toml
下载下来的frpc.toml 内容大概如下, 根据自己实际情况修改, 文件保存到 /root/docker/frpc/ 下面
serverAddr = "frp.freefrp.net"
serverPort = 7000
auth.method = "token"
auth.token = "freefrp.net"
[[proxies]]
name = "web1_xxxxx"
type = "http"
localIP = "192.168.1.2"
localPort = 5000
customDomains = ["nas.yourdomain.com"]
#加密
transport.useEncryption = true
#压缩
transport.useCompression = true
[[proxies]]
name = "web2_xxxxx"
type = "https"
localIP = "192.168.1.2"
localPort = 5001
customDomains = ["nas.yourdomain.com"]
[[proxies]]
name = "tcp1_xxxxx"
type = "tcp"
localIP = "192.168.1.3"
localPort = 22
remotePort = 22222
下面我们用docker-compose来执行,编辑 docker-compose.yml 文件,也放到/root/docker/frpc/ 下面,内容如下
version: '3.9'
services:
frpc:
image: stilleshan/frpc
volumes:
- '/root/docker/frpc/frpc.toml:/frp/frpc.toml'
restart: always
container_name: frpc