1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
| # [common] 是必需的 [common] # ipv6的文本地址或主机名必须括在方括号中 # 如"[::1]:80", "[ipv6-host]:http" 或 "[ipv6-host%zone]:80" server_addr = 0.0.0.0 server_port = 7000
# 如果要通过 http 代理或 socks5 代理连接 frps,可以在此处或全局代理中设置 http_proxy # 只支持 tcp协议 # http_proxy = http://user:passwd@192.168.1.128:8080 # http_proxy = socks5://user:passwd@192.168.1.128:1080
# 控制台或真实日志文件路径,如./frps.log log_file = ./frpc.log
# 日志级别,分为trace(跟踪)、debug(调试)、info(信息)、warn(警告)、error(错误) log_level = info
# 最大日志记录天数 log_max_days = 3
# 认证 token token = 12345678
# 设置能够通过 http api 控制客户端操作的管理地址 admin_addr = 127.0.0.1 admin_port = 7400 admin_user = admin admin_pwd = admin
# 将提前建立连接,默认值为 0 pool_count = 5
# 是否使用 tcp 流多路复用,默认值为 true,必需与服务端相同 tcp_mux = true
# 在此处设置用户名后,代理名称将设置为 {用户名}.{代理名} user = your_name
# 决定第一次登录失败时是否退出程序,否则继续重新登录到 frps # 默认为 true login_fail_exit = true
# 用于连接到服务器的通信协议 # 目前支持 tcp/kcp/websocket, 默认 tcp protocol = tcp
# 如果 tls_enable 为 true, frpc 将会通过 tls 连接 frps tls_enable = true
# 指定 DNS 服务器 # dns_server = 8.8.8.8
# 代理名, 使用 ',' 分隔 # 默认为空, 表示全部代理 # start = ssh,dns
# 心跳配置, 不建议对默认值进行修改 # heartbeat_interval 默认为 10 heartbeat_timeout 默认为 90 # heartbeat_interval = 30 # heartbeat_timeout = 90
# 'ssh' 是一个特殊代理名称 [ssh] # 协议 tcp | udp | http | https | stcp | xtcp, 默认 tcp type = tcp local_ip = 127.0.0.1 local_port = 22 # 是否加密, 默认为 false use_encryption = false # 是否压缩 use_compression = false # 服务端端口 remote_port = 6001 # frps 将为同一组中的代理进行负载平衡连接 group = test_group # 组应该有相同的组密钥 group_key = 123456 # 为后端服务开启健康检查, 目前支持 'tcp' 和 'http' # frpc 将连接本地服务的端口以检测其健康状态 health_check_type = tcp # 健康检查连接超时 health_check_timeout_s = 3 # 连续 3 次失败, 代理将会从服务端中被移除 health_check_max_failed = 3 # 健康检查时间间隔 health_check_interval_s = 10
[ssh_random] type = tcp local_ip = 127.0.0.1 local_port = 22 # 如果 remote_port 为 0 ,frps 将为您分配一个随机端口 remote_port = 0
# 如果要暴露多个端口, 在区块名称前添加 'range:' 前缀 # frpc 将会生成多个代理,如 'tcp_port_6010', 'tcp_port_6011' [range:tcp_port] type = tcp local_ip = 127.0.0.1 local_port = 6010-6020,6022,6024-6028 remote_port = 6010-6020,6022,6024-6028 use_encryption = false use_compression = false
[dns] type = udp local_ip = 114.114.114.114 local_port = 53 remote_port = 6002 use_encryption = false use_compression = false
[range:udp_port] type = udp local_ip = 127.0.0.1 local_port = 6010-6020 remote_port = 6010-6020 use_encryption = false use_compression = false
# 将域名解析到 [server_addr] 可以使用 http://web01.yourdomain.com 访问 web01 [web01] type = http local_ip = 127.0.0.1 local_port = 80 use_encryption = false use_compression = true # http 协议认证 http_user = admin http_pwd = admin # 如果服务端域名为 frps.com, 可以通过 http://test.frps.com 来访问 [web01] subdomain = web01 custom_domains = web02.yourdomain.com # locations 仅可用于HTTP类型 locations = /,/pic host_header_rewrite = example.com # params with prefix "header_" will be used to update http request headers header_X-From-Where = frp health_check_type = http # frpc 将会发送一个 GET http 请求 '/status' 来定位http服务 # http 服务返回 2xx 状态码时即为存活 health_check_url = /status health_check_interval_s = 10 health_check_max_failed = 3 health_check_timeout_s = 3
[web02] type = https local_ip = 127.0.0.1 local_port = 8000 use_encryption = false use_compression = false subdomain = web01 custom_domains = web02.yourdomain.com # v1 或 v2 或 空 proxy_protocol_version = v2
[plugin_unix_domain_socket] type = tcp remote_port = 6003 plugin = unix_domain_socket plugin_unix_path = /var/run/docker.sock
[plugin_http_proxy] type = tcp remote_port = 6004 plugin = http_proxy plugin_http_user = abc plugin_http_passwd = abc
[plugin_socks5] type = tcp remote_port = 6005 plugin = socks5 plugin_user = abc plugin_passwd = abc
[plugin_static_file] type = tcp remote_port = 6006 plugin = static_file plugin_local_path = /var/www/blog plugin_strip_prefix = static plugin_http_user = abc plugin_http_passwd = abc
[plugin_https2http] type = https custom_domains = test.yourdomain.com plugin = https2http plugin_local_addr = 127.0.0.1:80 plugin_crt_path = ./server.crt plugin_key_path = ./server.key plugin_host_header_rewrite = 127.0.0.1
[secret_tcp] # 如果类型为 secret tcp, remote_port 将失效 type = stcp # sk 用来进行访客认证 sk = abcdefg local_ip = 127.0.0.1 local_port = 22 use_encryption = false use_compression = false
# 访客端及服务端的用户名应该相同 [secret_tcp_visitor] # frpc role visitor -> frps -> frpc role server role = visitor type = stcp # 要访问的服务器名称 server_name = secret_tcp sk = abcdefg # 将此地址连接到访客 stcp 服务器 bind_addr = 127.0.0.1 bind_port = 9000 use_encryption = false use_compression = false
[p2p_tcp] type = xtcp sk = abcdefg local_ip = 127.0.0.1 local_port = 22 use_encryption = false use_compression = false
[p2p_tcp_visitor] role = visitor type = xtcp server_name = p2p_tcp sk = abcdefg bind_addr = 127.0.0.1 bind_port = 9001 use_encryption = false use_compression = false
|