GITHUB仓库地址:https://github.com/fatedier/frp
Server端配置
bindPort = 7000
# The default value is 127.0.0.1. Change it to 0.0.0.0 when you want to access it from a public network.
webServer.addr = "0.0.0.0"
webServer.port = 7500
# dashboard's username and password are both optional
webServer.user = "admin"
webServer.password = "admin"
auth.token = "password"
auth.method = "token"
其中指定了Web UI的端口为 7500,验证方式为 “token” ,token为password,Web端用户名和密码分别是 admin
和 password
。
后台运行
sudo nohup ./frps -c frps.toml &
本地端配置
serverAddr = "服务器IP"
serverPort = 7000
auth.method = "token"
auth.token = "password"
[[proxies]]
name = "kafka"
type = "tcp"
localIP = "192.168.1.5"
localPort = 9092
remotePort = 9092
[[proxies]]
name = "zookeeper"
type = "tcp"
localIP = "192.168.1.5"
localPort = 2181
remotePort = 2181
此处穿透了本地的两个端口
启动
sudo ./frpc -c frpc.toml