frps.ini配置文件详解
[common] # 通用配置段bind_addr = 0.0.0.0 # 绑定的IP地址,支持IPv6,不指定默认0.0.0.0;bind_port = 7000 # 服务端口;bind_udp_port = 7001 # 是否使用udp端口,不使用删除或注释本行;kcp_bind_port = 7000 # 是否使用kcp协议,不使用删除或注释本行;# proxy_bind_addr = 127.0.0.1 # 代理监听地址,默认和bind_addr相同;
# 虚拟主机vhost_http_port = 80 # 是否启用虚拟主机,端口可以和bind_port相同;vhost_https_port = 443vhost_http_timeout = 60 # 后端虚拟主机响应超时时间,默认为60s;
# 开启frps仪表盘可以检查frp的状态和代理的统计信息。dashboard_addr = 0.0.0.0 # frps仪表盘绑定的地址;dashboard_port = 7500 # frps仪表盘绑定的端口;dashboard_user = admin # 访问frps仪表盘的用户;dashboard_pwd = admin # 密码;assets_dir = ./static# 仪表盘页面文件目录,只适用于调试;
# 日志配置文件log_file = ./frps.log# 日志文件,不指定日志信息默认输出到控制台;log_level = info # 日志等级,可用等级“trace, debug, info, warn, error”;log_max_days = 3 # 日志保存最大保存时间;
token = 12345678 # 客户端与服务端通信的身份验证令牌
heartbeat_timeout = 90 # 心跳检测超时时间,不建议修改默认配置,默认值为90;?
# 指定允许客户端使用的端口范围,未指定则没有限制;allow_ports = 2000-3000,3001,3003,4000-50000
max_pool_count = 5 # 每个客户端连接服务端的最大连接数;max_ports_per_client = 0 # 每个客户端最大可以使用的端口,0表示无限制
authentication_timeout = 900 # 客户端连接超时时间(秒),默认为900s;
subdomain_host = frps.com # 自定义子域名,需要在dns中将域名解析为泛域名;
tcp_mux =true# 是否使用tcp复用,默认为true;# frp只对同意客户端的连接进行复用;
frpc.ini配置文件详解
[common] # 通用配置段server_addr = 0.0.0.0 # server的IP地址;支持IPv6server_port = 7000 # server的端口;# 如果要通过http或socks5代理连接frps,可以在此处或在全局环境变量中设置代理,只支持tcp协议;# http_proxy = http://user:passwd@192.168.1.128:8080# http_proxy = socks5://user:passwd@192.168.1.128:1080# 客户端日志log_file = ./frpc.log# 指定日志文件;log_level = info # 指定日志等级;log_max_days = 3token = 12345678 # 客户端与服务端通信的身份验证令牌tls_enable =true#从v0.25.0版本开始frpc和frps之间支持通过TLS协议加密传输。通过在frpc.ini的common中配置tls_ enable =true来启用此功能,安全性更高。#为了端口复用,frp建立TLS连接的第一个字节为0x17。#注意:启用此功能后除xtcp外,不需要再设置use. encryption。# 设置管理地址,用于通过http api控制frpc的动作,如重新加载;admin_addr = 127.0.0.1admin_port = 7400admin_user = adminadmin_passwd = adminpool_count = 5 # 初始连接池的数量,默认为0;tcp_mux =true# 是否启用tcp复用,默认为true;user = your_name # frpc的用户名,用于区别不用frpc的代理;login_fail_exit =true# 首次登录失败时退出程序,否则连续重新登录到frps;protocol = tcp # 用于连接服务器的协议,支持tcp、kcp、websocket;dns_server = 8.8.8.8 # 为frp 客户端指定一个单独的DNS服务器;# start = ssh,dns # 要启用的代理的名字,默认为空表示所有代理;# 心跳检查# heartbeat_interval = 30 # 失败重试次数# heartbeat_timeout = 90 # 超时时间# 配置示例[ssh] # 代理配置段名称,如果配置user=your_name,则显示为your_name.ssh;type = tcp # 协议默认tcp,可选tcp,udp,http,https,stcp,xtcp;local_ip = 127.0.0.1 # 本地地址local_port = 22 # 本地端口use_encryption =false# 是否加密服务端和客户端的通信信息,默认为不加密;use_compression =false# 是否开启压缩,默认不开启;remote_port = 6001 # 在服务器端开启的远程端口;# 负载均衡配置group = test_group # 负载均衡组名,会将同一组内的客户端进行负载;group_key = 123456 # 负载均衡组密钥;# web示例[web01]type = http # 使用httplocal_ip = 127.0.0.1local_port = 80use_encryption =falseuse_compression =truehttp_user = admin # 访问web01页面启用认证,用户名adminhttp_pwd = admin # 密码subdomain = web01 # 子域名,需要服务端配置了subdomain_host参数;custom_domains = web02.example.com # web01的域名,和subdomain二选一locations = /,/pic # 指定用于路由的URL前缀;host_header_rewrite = example.com # 配置http包头域名重写;header_X-From-Where = frp # 添加包头信息X-From-Where: frp;
最新回复