| 1 | # [common] is integral section |
| 2 | [common] |
| 3 | # A literal address or host name for IPv6 must be enclosed |
| 4 | # in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80" |
| 5 | # For single "server_addr" field, no need square brackets, like "server_addr = ::". |
| 6 | server_addr = 0.0.0.0 |
| 7 | server_port = 7000 |
| 9 | # STUN server to help penetrate NAT hole. |
| 10 | # nat_hole_stun_server = stun.easyvoip.com:3478 |
| 11 |
| 12 | # The maximum amount of time a dial to server will wait for a connect to complete. Default value is 10 seconds. |
| 13 | # dial_server_timeout = 10 |
| 14 |
| 15 | # dial_server_keepalive specifies the interval between keep-alive probes for an active network connection between frpc and frps. |
| 16 | # If negative, keep-alive probes are disabled. |
| 17 | # dial_server_keepalive = 7200 |
| 18 |
| 19 | # if you want to connect frps by http proxy or socks5 proxy or ntlm proxy, you can set http_proxy here or in global environment variables |
| 20 | # it only works when protocol is tcp |
| 21 | # http_proxy = http://user:passwd@192.168.1.128:8080 |
| 22 | # http_proxy = socks5://user:passwd@192.168.1.128:1080 |
| 23 | # http_proxy = ntlm://user:passwd@192.168.1.128:2080 |
| 24 |
| 25 | # console or real logFile path like ./frpc.log |
| 26 | log_file = ./frpc.log |
| 27 |
| 28 | # trace, debug, info, warn, error |
| 29 | log_level = info |
| 30 |
| 31 | log_max_days = 3 |
| 32 |
| 33 | # disable log colors when log_file is console, default is false |
| 34 | disable_log_color = false |
| 35 |
| 36 | # for authentication, should be same as your frps.ini |
| 37 | # authenticate_heartbeats specifies whether to include authentication token in heartbeats sent to frps. By default, this value is false. |
| 38 | authenticate_heartbeats = false |
| 39 |
| 40 | # authenticate_new_work_conns specifies whether to include authentication token in new work connections sent to frps. By default, this value is false. |
| 41 | authenticate_new_work_conns = false |
| 42 |
| 43 | # auth token |
| 44 | token = 12345678 |
| 45 |
| 46 | authentication_method = |
| 47 |
| 48 | # oidc_client_id specifies the client ID to use to get a token in OIDC authentication if AuthenticationMethod == "oidc". |
| 49 | # By default, this value is "". |
| 50 | oidc_client_id = |
| 51 |
| 52 | # oidc_client_secret specifies the client secret to use to get a token in OIDC authentication if AuthenticationMethod == "oidc". |
| 53 | # By default, this value is "". |
| 54 | oidc_client_secret = |
| 55 |
| 56 | # oidc_audience specifies the audience of the token in OIDC authentication if AuthenticationMethod == "oidc". By default, this value is "". |
| 57 | oidc_audience = |
| 58 |
| 59 | # oidc_scope specifies the permissions of the token in OIDC authentication if AuthenticationMethod == "oidc". By default, this value is "". |
| 60 | oidc_scope = |
| 61 |
| 62 | # oidc_token_endpoint_url specifies the URL which implements OIDC Token Endpoint. |
| 63 | # It will be used to get an OIDC token if AuthenticationMethod == "oidc". By default, this value is "". |
| 64 | oidc_token_endpoint_url = |
| 65 |
| 66 | # oidc_additional_xxx specifies additional parameters to be sent to the OIDC Token Endpoint. |
| 67 | # For example, if you want to specify the "audience" parameter, you can set as follow. |
| 68 | # frp will add "audience=<value>" "var1=<value>" to the additional parameters. |
| 69 | # oidc_additional_audience = https://dev.auth.com/api/v2/ |
| 70 | # oidc_additional_var1 = foobar |
| 71 |
| 72 | # set admin address for control frpc's action by http api such as reload |
| 73 | admin_addr = 127.0.0.1 |
| 74 | admin_port = 7400 |
| 75 | admin_user = admin |
| 76 | admin_pwd = admin |
| 77 | # Admin assets directory. By default, these assets are bundled with frpc. |
| 78 | # assets_dir = ./static |
| 79 |
| 80 | # connections will be established in advance, default value is zero |
| 81 | pool_count = 5 |
| 82 |
| 83 | # if tcp stream multiplexing is used, default is true, it must be same with frps |
| 84 | # tcp_mux = true |
| 85 |
| 86 | # specify keep alive interval for tcp mux. |
| 87 | # only valid if tcp_mux is true. |
| 88 | # tcp_mux_keepalive_interval = 60 |
| 89 |
| 90 | # your proxy name will be changed to {user}.{proxy} |
| 91 | user = your_name |
| 92 |
| 93 | # decide if exit program when first login failed, otherwise continuous relogin to frps |
| 94 | # default is true |
| 95 | login_fail_exit = true |
| 96 |
| 97 | # communication protocol used to connect to server |
| 98 | # supports tcp, kcp, quic, websocket and wss now, default is tcp |
| 99 | protocol = tcp |
| 100 |
| 101 | # set client binding ip when connect server, default is empty. |
| 102 | # only when protocol = tcp or websocket, the value will be used. |
| 103 | connect_server_local_ip = 0.0.0.0 |
| 104 |
| 105 | # quic protocol options |
| 106 | # quic_keepalive_period = 10 |
| 107 | # quic_max_idle_timeout = 30 |
| 108 | # quic_max_incoming_streams = 100000 |
| 109 |
| 110 | # If tls_enable is true, frpc will connect frps by tls. |
| 111 | # Since v0.50.0, the default value has been changed to true, and tls is enabled by default. |
| 112 | tls_enable = true |
| 113 |
| 114 | # tls_cert_file = client.crt |
| 115 | # tls_key_file = client.key |
| 116 | # tls_trusted_ca_file = ca.crt |
| 117 | # tls_server_name = example.com |
| 118 |
| 119 | # specify a dns server, so frpc will use this instead of default one |
| 120 | # dns_server = 8.8.8.8 |
| 121 |
| 122 | # proxy names you want to start separated by ',' |
| 123 | # default is empty, means all proxies |
| 124 | # start = ssh,dns |
| 125 |
| 126 | # heartbeat configure, it's not recommended to modify the default value |
| 127 | # The default value of heartbeat_interval is 10 and heartbeat_timeout is 90. Set negative value |
| 128 | # to disable it. |
| 129 | # heartbeat_interval = 30 |
| 130 | # heartbeat_timeout = 90 |
| 131 |
| 132 | # additional meta info for client |
| 133 | meta_var1 = 123 |
| 134 | meta_var2 = 234 |
| 135 |
| 136 | # specify udp packet size, unit is byte. If not set, the default value is 1500. |
| 137 | # This parameter should be same between client and server. |
| 138 | # It affects the udp and sudp proxy. |
| 139 | udp_packet_size = 1500 |
| 140 |
| 141 | # include other config files for proxies. |
| 142 | # includes = ./confd/*.ini |
| 143 |
| 144 | # If the disable_custom_tls_first_byte is set to false, frpc will establish a connection with frps using the |
| 145 | # first custom byte when tls is enabled. |
| 146 | # Since v0.50.0, the default value has been changed to true, and the first custom byte is disabled by default. |
| 147 | disable_custom_tls_first_byte = true |
| 148 |
| 149 | # Enable golang pprof handlers in admin listener. |
| 150 | # Admin port must be set first. |
| 151 | pprof_enable = false |
| 152 |
| 153 | # 'ssh' is the unique proxy name |
| 154 | # if user in [common] section is not empty, it will be changed to {user}.{proxy} such as 'your_name.ssh' |
| 155 | [ssh] |
| 156 | # tcp | udp | http | https | stcp | xtcp, default is tcp |
| 157 | type = tcp |
| 158 | local_ip = 127.0.0.1 |
| 159 | local_port = 22 |
| 160 | # limit bandwidth for this proxy, unit is KB and MB |
| 161 | bandwidth_limit = 1MB |
| 162 | # where to limit bandwidth, can be 'client' or 'server', default is 'client' |
| 163 | bandwidth_limit_mode = client |
| 164 | # true or false, if true, messages between frps and frpc will be encrypted, default is false |
| 165 | use_encryption = false |
| 166 | # if true, message will be compressed |
| 167 | use_compression = false |
| 168 | # remote port listen by frps |
| 169 | remote_port = 6001 |
| 170 | # frps will load balancing connections for proxies in same group |
| 171 | group = test_group |
| 172 | # group should have same group key |
| 173 | group_key = 123456 |
| 174 | # enable health check for the backend service, it support 'tcp' and 'http' now |
| 175 | # frpc will connect local service's port to detect it's healthy status |
| 176 | health_check_type = tcp |
| 177 | # health check connection timeout |
| 178 | health_check_timeout_s = 3 |
| 179 | # if continuous failed in 3 times, the proxy will be removed from frps |
| 180 | health_check_max_failed = 3 |
| 181 | # every 10 seconds will do a health check |
| 182 | health_check_interval_s = 10 |
| 183 | # additional meta info for each proxy |
| 184 | meta_var1 = 123 |
| 185 | meta_var2 = 234 |
| 186 |
| 187 | [ssh_random] |
| 188 | type = tcp |
| 189 | local_ip = 127.0.0.1 |
| 190 | local_port = 22 |
| 191 | # if remote_port is 0, frps will assign a random port for you |
| 192 | remote_port = 0 |
| 193 |
| 194 | # if you want to expose multiple ports, add 'range:' prefix to the section name |
| 195 | # frpc will generate multiple proxies such as 'tcp_port_6010', 'tcp_port_6011' and so on. |
| 196 | [range:tcp_port] |
| 197 | type = tcp |
| 198 | local_ip = 127.0.0.1 |
| 199 | local_port = 6010-6020,6022,6024-6028 |
| 200 | remote_port = 6010-6020,6022,6024-6028 |
| 201 | use_encryption = false |
| 202 | use_compression = false |
| 203 |
| 204 | [dns] |
| 205 | type = udp |
| 206 | local_ip = 114.114.114.114 |
| 207 | local_port = 53 |
| 208 | remote_port = 6002 |
| 209 | use_encryption = false |
| 210 | use_compression = false |
| 211 |
| 212 | [range:udp_port] |
| 213 | type = udp |
| 214 | local_ip = 127.0.0.1 |
| 215 | local_port = 6010-6020 |
| 216 | remote_port = 6010-6020 |
| 217 | use_encryption = false |
| 218 | use_compression = false |
| 219 |
| 220 | # Resolve your domain names to [server_addr] so you can use http://web01.yourdomain.com to browse web01 and http://web02.yourdomain.com to browse web02 |
| 221 | [web01] |
| 222 | type = http |
| 223 | local_ip = 127.0.0.1 |
| 224 | local_port = 80 |
| 225 | use_encryption = false |
| 226 | use_compression = true |
| 227 | # http username and password are safety certification for http protocol |
| 228 | # if not set, you can access this custom_domains without certification |
| 229 | http_user = admin |
| 230 | http_pwd = admin |
| 231 | # if domain for frps is frps.com, then you can access [web01] proxy by URL http://web01.frps.com |
| 232 | subdomain = web01 |
| 233 | custom_domains = web01.yourdomain.com |
| 234 | # locations is only available for http type |
| 235 | locations = /,/pic |
| 236 | # route requests to this service if http basic auto user is abc |
| 237 | # route_by_http_user = abc |
| 238 | host_header_rewrite = example.com |
| 239 | # params with prefix "header_" will be used to update http request headers |
| 240 | header_X-From-Where = frp |
| 241 | health_check_type = http |
| 242 | # frpc will send a GET http request '/status' to local http service |
| 243 | # http service is alive when it return 2xx http response code |
| 244 | health_check_url = /status |
| 245 | health_check_interval_s = 10 |
| 246 | health_check_max_failed = 3 |
| 247 | health_check_timeout_s = 3 |
| 248 |
| 249 | [web02] |
| 250 | type = https |
| 251 | local_ip = 127.0.0.1 |
| 252 | local_port = 8000 |
| 253 | use_encryption = false |
| 254 | use_compression = false |
| 255 | subdomain = web02 |
| 256 | custom_domains = web02.yourdomain.com |
| 257 | # if not empty, frpc will use proxy protocol to transfer connection info to your local service |
| 258 | # v1 or v2 or empty |
| 259 | proxy_protocol_version = v2 |
| 260 |
| 261 | [plugin_unix_domain_socket] |
| 262 | type = tcp |
| 263 | remote_port = 6003 |
| 264 | # if plugin is defined, local_ip and local_port is useless |
| 265 | # plugin will handle connections got from frps |
| 266 | plugin = unix_domain_socket |
| 267 | # params with prefix "plugin_" that plugin needed |
| 268 | plugin_unix_path = /var/run/docker.sock |
| 269 |
| 270 | [plugin_http_proxy] |
| 271 | type = tcp |
| 272 | remote_port = 6004 |
| 273 | plugin = http_proxy |
| 274 | plugin_http_user = abc |
| 275 | plugin_http_passwd = abc |
| 276 |
| 277 | [plugin_socks5] |
| 278 | type = tcp |
| 279 | remote_port = 6005 |
| 280 | plugin = socks5 |
| 281 | plugin_user = abc |
| 282 | plugin_passwd = abc |
| 283 |
| 284 | [plugin_static_file] |
| 285 | type = tcp |
| 286 | remote_port = 6006 |
| 287 | plugin = static_file |
| 288 | plugin_local_path = /var/www/blog |
| 289 | plugin_strip_prefix = static |
| 290 | plugin_http_user = abc |
| 291 | plugin_http_passwd = abc |
| 292 |
| 293 | [plugin_https2http] |
| 294 | type = https |
| 295 | custom_domains = test.yourdomain.com |
| 296 | plugin = https2http |
| 297 | plugin_local_addr = 127.0.0.1:80 |
| 298 | plugin_crt_path = ./server.crt |
| 299 | plugin_key_path = ./server.key |
| 300 | plugin_host_header_rewrite = 127.0.0.1 |
| 301 | plugin_header_X-From-Where = frp |
| 302 |
| 303 | [plugin_https2https] |
| 304 | type = https |
| 305 | custom_domains = test.yourdomain.com |
| 306 | plugin = https2https |
| 307 | plugin_local_addr = 127.0.0.1:443 |
| 308 | plugin_crt_path = ./server.crt |
| 309 | plugin_key_path = ./server.key |
| 310 | plugin_host_header_rewrite = 127.0.0.1 |
| 311 | plugin_header_X-From-Where = frp |
| 312 |
| 313 | [plugin_http2https] |
| 314 | type = http |
| 315 | custom_domains = test.yourdomain.com |
| 316 | plugin = http2https |
| 317 | plugin_local_addr = 127.0.0.1:443 |
| 318 | plugin_host_header_rewrite = 127.0.0.1 |
| 319 | plugin_header_X-From-Where = frp |
| 320 |
| 321 | [secret_tcp] |
| 322 | # If the type is secret tcp, remote_port is useless |
| 323 | # Who want to connect local port should deploy another frpc with stcp proxy and role is visitor |
| 324 | type = stcp |
| 325 | # sk used for authentication for visitors |
| 326 | sk = abcdefg |
| 327 | local_ip = 127.0.0.1 |
| 328 | local_port = 22 |
| 329 | use_encryption = false |
| 330 | use_compression = false |
| 331 | # If not empty, only visitors from specified users can connect. |
| 332 | # Otherwise, visitors from same user can connect. '*' means allow all users. |
| 333 | allow_users = * |
| 334 |
| 335 | # user of frpc should be same in both stcp server and stcp visitor |
| 336 | [secret_tcp_visitor] |
| 337 | # frpc role visitor -> frps -> frpc role server |
| 338 | role = visitor |
| 339 | type = stcp |
| 340 | # the server name you want to visitor |
| 341 | server_name = secret_tcp |
| 342 | sk = abcdefg |
| 343 | # connect this address to visitor stcp server |
| 344 | bind_addr = 127.0.0.1 |
| 345 | # bind_port can be less than 0, it means don't bind to the port and only receive connections redirected from |
| 346 | # other visitors. (This is not supported for SUDP now) |
| 347 | bind_port = 9000 |
| 348 | use_encryption = false |
| 349 | use_compression = false |
| 350 |
| 351 | [p2p_tcp] |
| 352 | type = xtcp |
| 353 | sk = abcdefg |
| 354 | local_ip = 127.0.0.1 |
| 355 | local_port = 22 |
| 356 | use_encryption = false |
| 357 | use_compression = false |
| 358 | # If not empty, only visitors from specified users can connect. |
| 359 | # Otherwise, visitors from same user can connect. '*' means allow all users. |
| 360 | allow_users = user1, user2 |
| 361 |
| 362 | [p2p_tcp_visitor] |
| 363 | role = visitor |
| 364 | type = xtcp |
| 365 | # if the server user is not set, it defaults to the current user |
| 366 | server_user = user1 |
| 367 | server_name = p2p_tcp |
| 368 | sk = abcdefg |
| 369 | bind_addr = 127.0.0.1 |
| 370 | # bind_port can be less than 0, it means don't bind to the port and only receive connections redirected from |
| 371 | # other visitors. (This is not supported for SUDP now) |
| 372 | bind_port = 9001 |
| 373 | use_encryption = false |
| 374 | use_compression = false |
| 375 | # when automatic tunnel persistence is required, set it to true |
| 376 | keep_tunnel_open = false |
| 377 | # effective when keep_tunnel_open is set to true, the number of attempts to punch through per hour |
| 378 | max_retries_an_hour = 8 |
| 379 | min_retry_interval = 90 |
| 380 | # fallback_to = stcp_visitor |
| 381 | # fallback_timeout_ms = 500 |
| 382 |
| 383 | [tcpmuxhttpconnect] |
| 384 | type = tcpmux |
| 385 | multiplexer = httpconnect |
| 386 | local_ip = 127.0.0.1 |
| 387 | local_port = 10701 |
| 388 | custom_domains = tunnel1 |
| 389 | # route_by_http_user = user1 |