赞
踩
frpc.ini 文件 写法 :
[common]
server_addr = xxx.xx.xxx.xxx
server_port = 7000
[web]
type = http
local_port = 9090
local_ip = 127.0.0.1
custom_domains = xxx.xx.xxx.xxx
注: xxx.xx.xxx.xxx 为公网ip地址
以上 2行和8行 xxx.xx.xxx.xxx 保持 一致
客户端运行命令 : frpc -c frpc.ini
frps.ini 文件写法
[common]
bind_port = 7000
vhost_http_port = 6001
服务端 运行 命令 ./frps -c frps.ini
其中 第三行 为 web 映射后的端口
外网访问 在浏览器地址 输入 :xxx.xx.xxx.xxx:6001
即可访问 内网的网站 127.0.0.1:9090
本地多个web端口映射外网配置方法
frps.ini
[common] bind_port = 7000 vhost_http_port = 8011 dashboard_port = 7500 dashboard_user = admin dashboard_pwd = admin [ssh] listen_port = 6000 auth_token = 123456 [web1] type = http custom_domains = app1.abc.fun auth_token = 123456 [web2] type = http custom_domains = app2.abc.fun auth_token = 123456
app1.abc.fun 和 app2.abc.fun 是外网域名,需要配置域名解析服务器,在外网能过ping通
frpc.ini
[common] server_addr = xx.xx.xx.xx server_port = 7000 auth_token = 123456 vhost_http_port = 8011 [web01] type = http local_ip = 127.0.0.1 local_port = 9092 custom_domains = app1.abc.fun [web02] type = http local_ip = 127.0.0.1 local_port = 9090 custom_domains = app2.abc.fun
xx.xx.xx.xx为 公网 ip
访问 web01时: app1.abc.fun:8011
访问 web02时: app2.abc.fun:8011
frps.ini 也可以这样写 不用配置 web01 web02
[common]
bind_port = 7000
vhost_http_port = 8011
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
[ssh]
listen_port = 6000
auth_token = 123456
第三中配置方案参照:
frps.ini
[common]
bind_port = 7000
vhost_http_port = 8011
subdomain_host = abc.com
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
[ssh]
listen_port = 6000
auth_token = 123456
frpc.ini
[common] server_addr = XX.XX.XX.XX server_port = 7000 auth_token = 123456 vhost_http_port = 8011 [web01] type = http local_ip = 127.0.0.1 local_port = 8011 subdomain = app1 [web02] type = http local_ip = 127.0.0.1 local_port = 9090 subdomain = app2
以上6行 和 11行 名字不能一样,一样的话 只有11行配置生效,6行配置不生效。
访问web01 http://app1.abc.com:8011/
访问web02 http://app2.abc.com:8011/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。