【frp】新版本 frp 参考配置分享
# your proxy name will be changed to {user}.{proxy}
user = "your_name"
# A literal address or host name for IPv6 must be enclosed
# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
# For single serverAddr field, no need square brackets, like serverAddr = "::".
serverAddr = "0.0.0.0"
serverPort = 7000
# STUN server to help penetrate NAT hole.
# natHoleStunServer = ":3478"
# Decide if exit program when first login failed, otherwise continuous relogin to frps
# default is true
loginFailExit = true
# console or real logFile path like ./
= "./"
# trace, debug, info, warn, error
= "info"
= 3
# disable log colors when is console, default is false
= false
= "token"
# specifies additional scopes to include authentication information.
# Optional values are HeartBeats, NewWorkConns.
# = ["HeartBeats", "NewWorkConns"]
# auth token
= "12345678"
# specifies the client ID to use to get a token in OIDC authentication.
# = ""
# specifies the client secret to use to get a token in OIDC authentication.
# = ""
# specifies the audience of the token in OIDC authentication.
# = ""
# oidc_scope specifies the permisssions of the token in OIDC authentication if AuthenticationMethod == "oidc". By default, this value is "".
# = ""
# specifies the URL which implements OIDC Token Endpoint.
# It will be used to get an OIDC token.
# = ""
# specifies additional parameters to be sent to the OIDC Token Endpoint.
# For example, if you want to specify the "audience" parameter, you can set as follow.
# frp will add "audience=<value>" "var1=<value>" to the additional parameters.
# = "/api/v2/"
# .var1 = "foobar"
# Set admin address for control frpc's action by http api such as reload
= "127.0.0.1"
= 7400
= "admin"
= "admin"
# Admin assets directory. By default, these assets are bundled with frpc.
# = "./static"
# Enable golang pprof handlers in admin listener.
= false
# The maximum amount of time a dial to server will wait for a connect to complete. Default value is 10 seconds.
# = 10
# dialServerKeepalive specifies the interval between keep-alive probes for an active network connection between frpc and frps.
# If negative, keep-alive probes are disabled.
# = 7200
# connections will be established in advance, default value is zero
= 5
# If tcp stream multiplexing is used, default is true, it must be same with frps
# = true
# Specify keep alive interval for tcp mux.
# only valid if tcpMux is enabled.
# = 60
# Communication protocol used to connect to server
# supports tcp, kcp, quic, websocket and wss now, default is tcp
= "tcp"
# set client binding ip when connect server, default is empty.
# only when protocol = tcp or websocket, the value will be used.
= "0.0.0.0"
# 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
# it only works when protocol is tcp
# = "http://user:passwd@192.168.1.128:8080"
# = "socks5://user:passwd@192.168.1.128:1080"
# = "ntlm://user:passwd@192.168.1.128:2080"
# quic protocol options
# = 10
# = 30
# = 100000
# If is true, frpc will connect frps by tls.
# Since v0.50.0, the default value has been changed to true, and tls is enabled by default.
= true
# = ""
# = ""
# = ""
# = ""
# If the disableCustomTLSFirstByte is set to false, frpc will establish a connection with frps using the
# first custom byte when tls is enabled.
# Since v0.50.0, the default value has been changed to true, and the first custom byte is disabled by default.
# = true
# Heartbeat configure, it's not recommended to modify the default value.
# The default value of heartbeat_interval is 10 and heartbeat_timeout is 90. Set negative value
# to disable it.
# = 30
# = 90
# Specify a dns server, so frpc will use this instead of default one
# dnsServer = "8.8.8.8"
# Proxy names you want to start.
# Default is empty, means all proxies.
# start = ["ssh", "dns"]
# Specify udp packet size, unit is byte. If not set, the default value is 1500.
# This parameter should be same between client and server.
# It affects the udp and sudp proxy.
udpPacketSize = 1500
# Additional metadatas for client.
metadatas.var1 = "abc"
metadatas.var2 = "123"
# Include other config files for proxies.
# includes = ["./confd/*.ini"]
[[proxies]]
# 'ssh' is the unique proxy name
# If global user is not empty, it will be changed to {user}.{proxy} such as 'your_name.ssh'
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
# Limit bandwidth for this proxy, unit is KB and MB
= "1MB"
# Where to limit bandwidth, can be 'client' or 'server', default is 'client'
= "client"
# If true, traffic of this proxy will be encrypted, default is false
= false
# If true, traffic will be compressed
= false
# Remote port listen by frps
remotePort = 6001
# frps will load balancing connections for proxies in same group
= "test_group"
# group should have same group key
= "123456"
# Enable health check for the backend service, it supports 'tcp' and 'http' now.
# frpc will connect local service's port to detect it's healthy status
= "tcp"
# Health check connection timeout
= 3
# If continuous failed in 3 times, the proxy will be removed from frps
= 3
# every 10 seconds will do a health check
= 10
# additional meta info for each proxy
metadatas.var1 = "abc"
metadatas.var2 = "123"
[[proxies]]
name = "ssh_random"
type = "tcp"
localIP = "192.168.31.100"
localPort = 22
# If remote_port is 0, frps will assign a random port for you
remotePort = 0
[[proxies]]
name = "dns"
type = "udp"
localIP = "114.114.114.114"
localPort = 53
remotePort = 6002
# Resolve your domain names to [server_addr] so you can use to browse web01 and to browse web02
[[proxies]]
name = "web01"
type = "http"
localIP = "127.0.0.1"
localPort = 80
# http username and password are safety certification for http protocol
# if not set, you can access this custom_domains without certification
httpUser = "admin"
httpPassword = "admin"
# if domain for frps is , then you can access [web01] proxy by URL
subdomain = "web01"
customDomains = [""]
# locations is only available for http type
locations = ["/", "/pic"]
# route requests to this service if http basic auto user is abc
# route_by_http_user = abc
hostHeaderRewrite = ""
# params with prefix "header_" will be used to update http request headers
-from-where = "frp"
= "http"
# frpc will send a GET http request '/status' to local http service
# http service is alive when it return 2xx http response code
= "/status"
= 10
= 3
= 3
[[proxies]]
name = "web02"
type = "https"
localIP = "127.0.0.1"
localPort = 8000
subdomain = "web02"
customDomains = [""]
# if not empty, frpc will use proxy protocol to transfer connection info to your local service
# v1 or v2 or empty
= "v2"
[[proxies]]
name = "tcpmuxhttpconnect"
type = "tcpmux"
multiplexer = "httpconnect"
localIP = "127.0.0.1"
localPort = 10701
customDomains = ["tunnel1"]
# routeByHTTPUser = "user1"
[[proxies]]
name = "plugin_unix_domain_socket"
type = "tcp"
remotePort = 6003
# if plugin is defined, local_ip and local_port is useless
# plugin will handle connections got from frps
[]
type = "unix_domain_socket"
unixPath = "/var/run/"
[[proxies]]
name = "plugin_http_proxy"
type = "tcp"
remotePort = 6004
[]
type = "http_proxy"
httpUser = "abc"
httpPassword = "abc"
[[proxies]]
name = "plugin_socks5"
type = "tcp"
remotePort = 6005
[]
type = "socks5"
username = "abc"
password = "abc"
[[proxies]]
name = "plugin_static_file"
type = "tcp"
remotePort = 6006
[]
type = "static_file"
localPath = "/var/www/blog"
stripPrefix = "static"
httpUser = "abc"
httpPassword = "abc"
[[proxies]]
name = "plugin_https2http"
type = "https"
customDomains = [""]
[]
type = "https2http"
localAddr = "127.0.0.1:80"
crtPath = "./"
keyPath = "./"
hostHeaderRewrite = "127.0.0.1"
-from-where = "frp"
[[proxies]]
name = "plugin_https2https"
type = "https"
customDomains = [""]
[]
type = "https2https"
localAddr = "127.0.0.1:443"
crtPath = "./"
keyPath = "./"
hostHeaderRewrite = "127.0.0.1"
-from-where = "frp"
[[proxies]]
name = "plugin_http2https"
type = "http"
customDomains = [""]
[]
type = "http2https"
localAddr = "127.0.0.1:443"
hostHeaderRewrite = "127.0.0.1"
-from-where = "frp"
[[proxies]]
name = "secret_tcp"
# If the type is secret tcp, remote_port is useless
# Who want to connect local port should deploy another frpc with stcp proxy and role is visitor
type = "stcp"
# secretKey is used for authentication for visitors
secretKey = "abcdefg"
localIP = "127.0.0.1"
localPort = 22
# If not empty, only visitors from specified users can connect.
# Otherwise, visitors from same user can connect. '*' means allow all users.
allowUsers = ["*"]
[[proxies]]
name = "p2p_tcp"
type = "xtcp"
secretKey = "abcdefg"
localIP = "127.0.0.1"
localPort = 22
# If not empty, only visitors from specified users can connect.
# Otherwise, visitors from same user can connect. '*' means allow all users.
allowUsers = ["user1", "user2"]
# frpc role visitor -> frps -> frpc role server
[[visitors]]
name = "secret_tcp_visitor"
type = "stcp"
# the server name you want to visitor
serverName = "secret_tcp"
secretKey = "abcdefg"
# connect this address to visitor stcp server
bindAddr = "127.0.0.1"
# bindPort can be less than 0, it means don't bind to the port and only receive connections redirected from
# other visitors. (This is not supported for SUDP now)
bindPort = 9000
[[visitors]]
name = "p2p_tcp_visitor"
type = "xtcp"
# if the server user is not set, it defaults to the current user
serverUser = "user1"
serverName = "p2p_tcp"
secretKey = "abcdefg"
bindAddr = "127.0.0.1"
# bindPort can be less than 0, it means don't bind to the port and only receive connections redirected from
# other visitors. (This is not supported for SUDP now)
bindPort = 9001
# when automatic tunnel persistence is required, set it to true
keepTunnelOpen = false
# effective when keep_tunnel_open is set to true, the number of attempts to punch through per hour
maxRetriesAnHour = 8
minRetryInterval = 90
# fallbackTo = "stcp_visitor"
# fallbackTimeoutMs = 500