| 1 | # This configuration file is for reference only. Please do not use this configuration directly to run the program as it may have various issues. |
| 2 | |
| 3 | # Optional unique identifier for this frpc instance. |
| 4 | clientID = "your_client_id" |
| 5 | # your proxy name will be changed to {user}.{proxy} |
| 6 | user = "your_name" |
| 7 | |
| # A literal address or host name for IPv6 must be enclosed |
| 9 | # in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80" |
| 10 | # For single serverAddr field, no need square brackets, like serverAddr = "::". |
| 11 | serverAddr = "0.0.0.0" |
| 12 | serverPort = 7000 |
| 13 |
| 14 | # STUN server to help penetrate NAT hole. |
| 15 | # natHoleStunServer = "stun.easyvoip.com:3478" |
| 16 |
| 17 | # Decide if exit program when first login failed, otherwise continuous relogin to frps |
| 18 | # default is true |
| 19 | loginFailExit = true |
| 20 |
| 21 | # console or real logFile path like ./frpc.log |
| 22 | log.to = "./frpc.log" |
| 23 | # trace, debug, info, warn, error |
| 24 | log.level = "info" |
| 25 | log.maxDays = 3 |
| 26 | # disable log colors when log.to is console, default is false |
| 27 | log.disablePrintColor = false |
| 28 |
| 29 | auth.method = "token" |
| 30 | # auth.additionalScopes specifies additional scopes to include authentication information. |
| 31 | # Optional values are HeartBeats, NewWorkConns. |
| 32 | # auth.additionalScopes = ["HeartBeats", "NewWorkConns"] |
| 33 |
| 34 | # auth token |
| 35 | auth.token = "12345678" |
| 36 |
| 37 | # alternatively, you can use tokenSource to load the token from a file |
| 38 | # this is mutually exclusive with auth.token |
| 39 | # auth.tokenSource.type = "file" |
| 40 | # auth.tokenSource.file.path = "/etc/frp/token" |
| 41 |
| 42 | # oidc.clientID specifies the client ID to use to get a token in OIDC authentication. |
| 43 | # auth.oidc.clientID = "" |
| 44 | # oidc.clientSecret specifies the client secret to use to get a token in OIDC authentication. |
| 45 | # auth.oidc.clientSecret = "" |
| 46 | # oidc.audience specifies the audience of the token in OIDC authentication. |
| 47 | # auth.oidc.audience = "" |
| 48 | # oidc.scope specifies the permissions of the token in OIDC authentication if AuthenticationMethod == "oidc". By default, this value is "". |
| 49 | # auth.oidc.scope = "" |
| 50 | # oidc.tokenEndpointURL specifies the URL which implements OIDC Token Endpoint. |
| 51 | # It will be used to get an OIDC token. |
| 52 | # auth.oidc.tokenEndpointURL = "" |
| 53 |
| 54 | # oidc.additionalEndpointParams specifies additional parameters to be sent to the OIDC Token Endpoint. |
| 55 | # For example, if you want to specify the "audience" parameter, you can set as follow. |
| 56 | # frp will add "audience=<value>" "var1=<value>" to the additional parameters. |
| 57 | # auth.oidc.additionalEndpointParams.audience = "https://dev.auth.com/api/v2/" |
| 58 | # auth.oidc.additionalEndpointParams.var1 = "foobar" |
| 59 |
| 60 | # OIDC TLS and proxy configuration |
| 61 | # Specify a custom CA certificate file for verifying the OIDC token endpoint's TLS certificate. |
| 62 | # This is useful when the OIDC provider uses a self-signed certificate or a custom CA. |
| 63 | # auth.oidc.trustedCaFile = "/path/to/ca.crt" |
| 64 |
| 65 | # Skip TLS certificate verification for the OIDC token endpoint. |
| 66 | # INSECURE: Only use this for debugging purposes, not recommended for production. |
| 67 | # auth.oidc.insecureSkipVerify = false |
| 68 |
| 69 | # Specify a proxy server for OIDC token endpoint connections. |
| 70 | # Supports http, https, socks5, and socks5h proxy protocols. |
| 71 | # If not specified, no proxy is used for OIDC connections. |
| 72 | # auth.oidc.proxyURL = "http://proxy.example.com:8080" |
| 73 |
| 74 | # Set admin address for control frpc's action by http api such as reload |
| 75 | webServer.addr = "127.0.0.1" |
| 76 | webServer.port = 7400 |
| 77 | webServer.user = "admin" |
| 78 | webServer.password = "admin" |
| 79 | # Admin assets directory. By default, these assets are bundled with frpc. |
| 80 | # webServer.assetsDir = "./static" |
| 81 |
| 82 | # Enable golang pprof handlers in admin listener. |
| 83 | webServer.pprofEnable = false |
| 84 |
| 85 | # The maximum amount of time a dial to server will wait for a connect to complete. Default value is 10 seconds. |
| 86 | # transport.dialServerTimeout = 10 |
| 87 |
| 88 | # dialServerKeepalive specifies the interval between keep-alive probes for an active network connection between frpc and frps. |
| 89 | # If negative, keep-alive probes are disabled. |
| 90 | # transport.dialServerKeepalive = 7200 |
| 91 |
| 92 | # connections will be established in advance, default value is zero |
| 93 | transport.poolCount = 5 |
| 94 |
| 95 | # If tcp stream multiplexing is used, default is true, it must be same with frps |
| 96 | # transport.tcpMux = true |
| 97 |
| 98 | # Specify keep alive interval for tcp mux. |
| 99 | # only valid if tcpMux is enabled. |
| 100 | # transport.tcpMuxKeepaliveInterval = 30 |
| 101 |
| 102 | # Communication protocol used to connect to server |
| 103 | # supports tcp, kcp, quic, websocket and wss now, default is tcp |
| 104 | transport.protocol = "tcp" |
| 105 |
| 106 | # FRP wire protocol used inside the selected transport. |
| 107 | # supports v1 and v2, default is v1. v2 requires frps support and must be enabled explicitly. |
| 108 | # transport.wireProtocol = "v1" |
| 109 |
| 110 | # set client binding ip when connect server, default is empty. |
| 111 | # only when protocol = tcp or websocket, the value will be used. |
| 112 | transport.connectServerLocalIP = "0.0.0.0" |
| 113 |
| 114 | # if you want to connect frps by http proxy or socks5 proxy or ntlm proxy, you can set proxyURL here or in global environment variables |
| 115 | # it only works when protocol is tcp |
| 116 | # transport.proxyURL = "http://user:passwd@192.168.1.128:8080" |
| 117 | # transport.proxyURL = "socks5://user:passwd@192.168.1.128:1080" |
| 118 | # transport.proxyURL = "ntlm://user:passwd@192.168.1.128:2080" |
| 119 |
| 120 | # quic protocol options |
| 121 | # transport.quic.keepalivePeriod = 10 |
| 122 | # transport.quic.maxIdleTimeout = 30 |
| 123 | # transport.quic.maxIncomingStreams = 100000 |
| 124 |
| 125 | # If tls.enable is true, frpc will connect frps by tls. |
| 126 | # Since v0.50.0, the default value has been changed to true, and tls is enabled by default. |
| 127 | transport.tls.enable = true |
| 128 |
| 129 | # transport.tls.certFile = "client.crt" |
| 130 | # transport.tls.keyFile = "client.key" |
| 131 | # transport.tls.trustedCaFile = "ca.crt" |
| 132 | # transport.tls.serverName = "example.com" |
| 133 |
| 134 | # If the disableCustomTLSFirstByte is set to false, frpc will establish a connection with frps using the |
| 135 | # first custom byte when tls is enabled. |
| 136 | # Since v0.50.0, the default value has been changed to true, and the first custom byte is disabled by default. |
| 137 | # transport.tls.disableCustomTLSFirstByte = true |
| 138 |
| 139 | # Heartbeat configure, it's not recommended to modify the default value. |
| 140 | # The default value of heartbeatInterval is 10 and heartbeatTimeout is 90. Set negative value |
| 141 | # to disable it. |
| 142 | # transport.heartbeatInterval = 30 |
| 143 | # transport.heartbeatTimeout = 90 |
| 144 |
| 145 | # Specify a dns server, so frpc will use this instead of default one |
| 146 | # dnsServer = "8.8.8.8" |
| 147 |
| 148 | # Proxy names you want to start. |
| 149 | # Default is empty, means all proxies. |
| 150 | # This list is a global allowlist after config + store are merged, so entries |
| 151 | # created via Store API are also filtered by this list. |
| 152 | # If start is non-empty, any proxy/visitor not listed here will not be started. |
| 153 | # start = ["ssh", "dns"] |
| 154 |
| 155 | # Alternative to 'start': You can control each proxy individually using the 'enabled' field. |
| 156 | # Set 'enabled = false' in a proxy configuration to disable it. |
| 157 | # If 'enabled' is not set or set to true, the proxy is enabled by default. |
| 158 | # The 'enabled' field provides more granular control and is recommended over 'start'. |
| 159 |
| 160 | # Specify udp packet size, unit is byte. If not set, the default value is 1500. |
| 161 | # This parameter should be same between client and server. |
| 162 | # It affects the udp and sudp proxy. |
| 163 | udpPacketSize = 1500 |
| 164 |
| 165 | # Feature gates allows you to enable or disable experimental features |
| 166 | # Format is a map of feature names to boolean values |
| 167 | # You can enable specific features: |
| 168 | #featureGates = { VirtualNet = true } |
| 169 |
| 170 | # VirtualNet settings for experimental virtual network capabilities |
| 171 | # The virtual network feature requires enabling the VirtualNet feature gate above |
| 172 | # virtualNet.address = "100.86.1.1/24" |
| 173 |
| 174 | # Additional metadatas for client. |
| 175 | metadatas.var1 = "abc" |
| 176 | metadatas.var2 = "123" |
| 177 |
| 178 | # Include other config files for proxies. |
| 179 | # includes = ["./confd/*.ini"] |
| 180 |
| 181 | [[proxies]] |
| 182 | # 'ssh' is the unique proxy name |
| 183 | # If global user is not empty, it will be changed to {user}.{proxy} such as 'your_name.ssh' |
| 184 | name = "ssh" |
| 185 | type = "tcp" |
| 186 | # Enable or disable this proxy. true or omit this field to enable, false to disable. |
| 187 | # enabled = true |
| 188 | localIP = "127.0.0.1" |
| 189 | localPort = 22 |
| 190 | # Limit bandwidth for this proxy, unit is KB and MB |
| 191 | transport.bandwidthLimit = "1MB" |
| 192 | # Where to limit bandwidth, can be 'client' or 'server', default is 'client' |
| 193 | transport.bandwidthLimitMode = "client" |
| 194 | # If true, traffic of this proxy will be encrypted, default is false |
| 195 | transport.useEncryption = false |
| 196 | # If true, traffic will be compressed |
| 197 | transport.useCompression = false |
| 198 | # Remote port listen by frps |
| 199 | remotePort = 6001 |
| 200 | # frps will load balancing connections for proxies in same group |
| 201 | loadBalancer.group = "test_group" |
| 202 | # group should have same group key |
| 203 | loadBalancer.groupKey = "123456" |
| 204 | # Enable health check for the backend service, it supports 'tcp' and 'http' now. |
| 205 | # frpc will connect local service's port to detect it's healthy status |
| 206 | healthCheck.type = "tcp" |
| 207 | # Health check connection timeout |
| 208 | healthCheck.timeoutSeconds = 3 |
| 209 | # If continuous failed in 3 times, the proxy will be removed from frps |
| 210 | healthCheck.maxFailed = 3 |
| 211 | # Every 10 seconds will do a health check |
| 212 | healthCheck.intervalSeconds = 10 |
| 213 | # Additional meta info for each proxy. It will be passed to the server-side plugin for use. |
| 214 | metadatas.var1 = "abc" |
| 215 | metadatas.var2 = "123" |
| 216 | # You can add some extra information to the proxy through annotations. |
| 217 | # These annotations will be displayed on the frps dashboard. |
| 218 | [proxies.annotations] |
| 219 | key1 = "value1" |
| 220 | "prefix/key2" = "value2" |
| 221 |
| 222 | [[proxies]] |
| 223 | name = "ssh_random" |
| 224 | type = "tcp" |
| 225 | localIP = "192.168.31.100" |
| 226 | localPort = 22 |
| 227 | # If remotePort is 0, frps will assign a random port for you |
| 228 | remotePort = 0 |
| 229 |
| 230 | [[proxies]] |
| 231 | name = "dns" |
| 232 | type = "udp" |
| 233 | localIP = "114.114.114.114" |
| 234 | localPort = 53 |
| 235 | remotePort = 6002 |
| 236 |
| 237 | # Resolve your domain names to [serverAddr] so you can use http://web01.yourdomain.com to browse web01 and http://web02.yourdomain.com to browse web02 |
| 238 | [[proxies]] |
| 239 | name = "web01" |
| 240 | type = "http" |
| 241 | localIP = "127.0.0.1" |
| 242 | localPort = 80 |
| 243 | # http username and password are safety certification for http protocol |
| 244 | # if not set, you can access this customDomains without certification |
| 245 | httpUser = "admin" |
| 246 | httpPassword = "admin" |
| 247 | # if domain for frps is frps.com, then you can access [web01] proxy by URL http://web01.frps.com |
| 248 | subdomain = "web01" |
| 249 | customDomains = ["web01.yourdomain.com"] |
| 250 | # locations is only available for http type |
| 251 | locations = ["/", "/pic"] |
| 252 | # route requests to this service if http basic auto user is abc |
| 253 | # routeByHTTPUser = abc |
| 254 | hostHeaderRewrite = "example.com" |
| 255 | requestHeaders.set.x-from-where = "frp" |
| 256 | responseHeaders.set.foo = "bar" |
| 257 | healthCheck.type = "http" |
| 258 | # frpc will send a GET http request '/status' to local http service |
| 259 | # http service is alive when it return 2xx http response code |
| 260 | healthCheck.path = "/status" |
| 261 | healthCheck.intervalSeconds = 10 |
| 262 | healthCheck.maxFailed = 3 |
| 263 | healthCheck.timeoutSeconds = 3 |
| 264 | # set health check headers |
| 265 | healthCheck.httpHeaders=[ |
| 266 | { name = "x-from-where", value = "frp" } |
| 267 | ] |
| 268 |
| 269 | [[proxies]] |
| 270 | name = "web02" |
| 271 | type = "https" |
| 272 | # Disable this proxy by setting enabled to false |
| 273 | # enabled = false |
| 274 | localIP = "127.0.0.1" |
| 275 | localPort = 8000 |
| 276 | subdomain = "web02" |
| 277 | customDomains = ["web02.yourdomain.com"] |
| 278 | # if not empty, frpc will use proxy protocol to transfer connection info to your local service |
| 279 | # v1 or v2 or empty |
| 280 | transport.proxyProtocolVersion = "v2" |
| 281 |
| 282 | [[proxies]] |
| 283 | name = "tcpmuxhttpconnect" |
| 284 | type = "tcpmux" |
| 285 | multiplexer = "httpconnect" |
| 286 | localIP = "127.0.0.1" |
| 287 | localPort = 10701 |
| 288 | customDomains = ["tunnel1"] |
| 289 | # routeByHTTPUser = "user1" |
| 290 |
| 291 | [[proxies]] |
| 292 | name = "plugin_unix_domain_socket" |
| 293 | type = "tcp" |
| 294 | remotePort = 6003 |
| 295 | # if plugin is defined, localIP and localPort is useless |
| 296 | # plugin will handle connections got from frps |
| 297 | [proxies.plugin] |
| 298 | type = "unix_domain_socket" |
| 299 | unixPath = "/var/run/docker.sock" |
| 300 |
| 301 | [[proxies]] |
| 302 | name = "plugin_http_proxy" |
| 303 | type = "tcp" |
| 304 | remotePort = 6004 |
| 305 | [proxies.plugin] |
| 306 | type = "http_proxy" |
| 307 | httpUser = "abc" |
| 308 | httpPassword = "abc" |
| 309 |
| 310 | [[proxies]] |
| 311 | name = "plugin_socks5" |
| 312 | type = "tcp" |
| 313 | remotePort = 6005 |
| 314 | [proxies.plugin] |
| 315 | type = "socks5" |
| 316 | username = "abc" |
| 317 | password = "abc" |
| 318 |
| 319 | [[proxies]] |
| 320 | name = "plugin_static_file" |
| 321 | type = "tcp" |
| 322 | remotePort = 6006 |
| 323 | [proxies.plugin] |
| 324 | type = "static_file" |
| 325 | localPath = "/var/www/blog" |
| 326 | stripPrefix = "static" |
| 327 | httpUser = "abc" |
| 328 | httpPassword = "abc" |
| 329 |
| 330 | [[proxies]] |
| 331 | name = "plugin_https2http" |
| 332 | type = "https" |
| 333 | customDomains = ["test.yourdomain.com"] |
| 334 | [proxies.plugin] |
| 335 | type = "https2http" |
| 336 | localAddr = "127.0.0.1:80" |
| 337 | crtPath = "./server.crt" |
| 338 | keyPath = "./server.key" |
| 339 | hostHeaderRewrite = "127.0.0.1" |
| 340 | requestHeaders.set.x-from-where = "frp" |
| 341 |
| 342 | [[proxies]] |
| 343 | name = "plugin_https2https" |
| 344 | type = "https" |
| 345 | customDomains = ["test.yourdomain.com"] |
| 346 | [proxies.plugin] |
| 347 | type = "https2https" |
| 348 | localAddr = "127.0.0.1:443" |
| 349 | crtPath = "./server.crt" |
| 350 | keyPath = "./server.key" |
| 351 | hostHeaderRewrite = "127.0.0.1" |
| 352 | requestHeaders.set.x-from-where = "frp" |
| 353 |
| 354 | [[proxies]] |
| 355 | name = "plugin_http2https" |
| 356 | type = "http" |
| 357 | customDomains = ["test.yourdomain.com"] |
| 358 | [proxies.plugin] |
| 359 | type = "http2https" |
| 360 | localAddr = "127.0.0.1:443" |
| 361 | hostHeaderRewrite = "127.0.0.1" |
| 362 | requestHeaders.set.x-from-where = "frp" |
| 363 |
| 364 | [[proxies]] |
| 365 | name = "plugin_http2http" |
| 366 | type = "tcp" |
| 367 | remotePort = 6007 |
| 368 | [proxies.plugin] |
| 369 | type = "http2http" |
| 370 | localAddr = "127.0.0.1:80" |
| 371 | hostHeaderRewrite = "127.0.0.1" |
| 372 | requestHeaders.set.x-from-where = "frp" |
| 373 |
| 374 | [[proxies]] |
| 375 | name = "plugin_tls2raw" |
| 376 | type = "tcp" |
| 377 | remotePort = 6008 |
| 378 | [proxies.plugin] |
| 379 | type = "tls2raw" |
| 380 | localAddr = "127.0.0.1:80" |
| 381 | crtPath = "./server.crt" |
| 382 | keyPath = "./server.key" |
| 383 |
| 384 | [[proxies]] |
| 385 | name = "secret_tcp" |
| 386 | # If the type is secret tcp, remotePort is useless |
| 387 | # Who want to connect local port should deploy another frpc with stcp proxy and role is visitor |
| 388 | type = "stcp" |
| 389 | # secretKey is used for authentication for visitors |
| 390 | secretKey = "abcdefg" |
| 391 | localIP = "127.0.0.1" |
| 392 | localPort = 22 |
| 393 | # If not empty, only visitors from specified users can connect. |
| 394 | # Otherwise, visitors from same user can connect. '*' means allow all users. |
| 395 | allowUsers = ["*"] |
| 396 |
| 397 | [[proxies]] |
| 398 | name = "p2p_tcp" |
| 399 | type = "xtcp" |
| 400 | secretKey = "abcdefg" |
| 401 | localIP = "127.0.0.1" |
| 402 | localPort = 22 |
| 403 | # If not empty, only visitors from specified users can connect. |
| 404 | # Otherwise, visitors from same user can connect. '*' means allow all users. |
| 405 | allowUsers = ["user1", "user2"] |
| 406 |
| 407 | # NAT traversal configuration (optional) |
| 408 | [proxies.natTraversal] |
| 409 | # Disable the use of local network interfaces (assisted addresses) for NAT traversal. |
| 410 | # When enabled, only STUN-discovered public addresses will be used. |
| 411 | # This can improve performance when you have slow VPN connections. |
| 412 | # Default: false |
| 413 | disableAssistedAddrs = false |
| 414 |
| 415 | [[proxies]] |
| 416 | name = "vnet-server" |
| 417 | type = "stcp" |
| 418 | secretKey = "your-secret-key" |
| 419 | [proxies.plugin] |
| 420 | type = "virtual_net" |
| 421 |
| 422 | # frpc role visitor -> frps -> frpc role server |
| 423 | [[visitors]] |
| 424 | name = "secret_tcp_visitor" |
| 425 | type = "stcp" |
| 426 | # the server name you want to visitor |
| 427 | serverName = "secret_tcp" |
| 428 | secretKey = "abcdefg" |
| 429 | # connect this address to visitor stcp server |
| 430 | bindAddr = "127.0.0.1" |
| 431 | # bindPort can be less than 0, it means don't bind to the port and only receive connections redirected from |
| 432 | # other visitors. (This is not supported for SUDP now) |
| 433 | bindPort = 9000 |
| 434 |
| 435 | [[visitors]] |
| 436 | name = "p2p_tcp_visitor" |
| 437 | type = "xtcp" |
| 438 | # if the server user is not set, it defaults to the current user |
| 439 | serverUser = "user1" |
| 440 | serverName = "p2p_tcp" |
| 441 | secretKey = "abcdefg" |
| 442 | bindAddr = "127.0.0.1" |
| 443 | # bindPort can be less than 0, it means don't bind to the port and only receive connections redirected from |
| 444 | # other visitors. (This is not supported for SUDP now) |
| 445 | bindPort = 9001 |
| 446 | # when automatic tunnel persistence is required, set it to true |
| 447 | keepTunnelOpen = false |
| 448 | # effective when keepTunnelOpen is set to true, the number of attempts to punch through per hour |
| 449 | maxRetriesAnHour = 8 |
| 450 | minRetryInterval = 90 |
| 451 | # fallbackTo = "stcp_visitor" |
| 452 | # fallbackTimeoutMs = 500 |
| 453 |
| 454 | # NAT traversal configuration (optional) |
| 455 | [visitors.natTraversal] |
| 456 | # Disable the use of local network interfaces (assisted addresses) for NAT traversal. |
| 457 | # When enabled, only STUN-discovered public addresses will be used. |
| 458 | # Default: false |
| 459 | disableAssistedAddrs = false |
| 460 |
| 461 | [[visitors]] |
| 462 | name = "vnet-visitor" |
| 463 | type = "stcp" |
| 464 | serverName = "vnet-server" |
| 465 | secretKey = "your-secret-key" |
| 466 | bindPort = -1 |
| 467 | [visitors.plugin] |
| 468 | type = "virtual_net" |
| 469 | destinationIP = "100.86.0.1" |