取包:https://github.com/fatedier/frp/releases
服務端:frps.ini
[common]
bind_addr = 0.0.0.0
bind_port = 7000
vhost_http_port = 8888
vhost_https_port = 444
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin123!@#
log_file = ./frps.log
log_level = info
log_max_days = 3
privilege_mode = true
privilege_token = tdj1nBQYXQHLn8KGGBGw4Qx2nCAQcs9q
privilege_allow_ports = 2000-3000,3001,3003,4000-50000
max_pool_count = 100
authentication_timeout = 900
subdomain_host = 4008528528.netgit
客戶端:frpc.ini
[common]
#server_addr = ****
server_addr = ****
server_port = 7000
log_file = ./frpc.log
log_level = info
log_max_days = 3
auth_token = tdj1nBQYXQHLn8KGGBGw4Qx2nCAQcs9q
privilege_token = tdj1nBQYXQHLn8KGGBGw4Qx2nCAQcs9qgithub
[web10.68.3.7]
privilege_mode = true
type = http
local_ip = 10.68.3.7
local_port = 80
use_gzip = true
subdomain = devops
custom_domains = web03.yourdomain.comweb
[privilege_ssh_10.68.3.7]
privilege_mode = true
type = tcp
local_ip = 10.68.3.7
local_port = 22
use_encryption = true
use_gzip = false
remote_port = 4001dom
啓動:
server:./frps -c frps.ini
client:./frpc -c frpc.inissh
啓動日誌:client
2017/04/27 14:57:02 [main.go:109] [I] Start frpc success
2017/04/27 14:57:02 [control.go:193] [I] ProxyName [web10.68.3.7], connect to server [*****:7000] success!
2017/04/27 14:57:02 [control.go:207] [I] Start to send heartbeat to frps
2017/04/27 14:57:02 [control.go:193] [I] ProxyName [privilege_ssh_10.68.3.7], connect to server [****:7000] success!
2017/04/27 14:57:02 [control.go:207] [I] Start to send heartbeat to frpstcp
server:
2017/04/27 14:57:01 [main.go:194] [I] Start frps success
2017/04/27 14:57:01 [main.go:196] [I] PrivilegeMode is enabled, you should pay more attention to security issues
2017/04/27 14:57:04 [control.go:344] [I] ProxyName [web10.68.3.7], start proxy success
2017/04/27 14:57:04 [control.go:346] [I] ProxyName [web10.68.3.7], created by PrivilegeMode
2017/04/27 14:57:04 [control.go:344] [I] ProxyName [privilege_ssh_10.68.3.7], start proxy success
2017/04/27 14:57:04 [control.go:346] [I] ProxyName [privilege_ssh_10.68.3.7], created by PrivilegeMode測試
服務端測試:
web:http://ip:7500 輸入帳號密碼,能夠看到有哪些客戶端連上了,以及對應的信息
ssh:經過終端軟件鏈接 server-ip client-port鏈接登陸,查看是不是客戶端的ip便可spa