Skip to content

Commit 3ae1a4f

Browse files
authored
update confugration examples and README (#3650)
1 parent 21d8e67 commit 3ae1a4f

17 files changed

+1105
-569
lines changed

Diff for: README.md

+488-508
Large diffs are not rendered by default.

Diff for: README_zh.md

-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ frp 是一个免费且开源的项目,我们欢迎任何人为其开发和进
9090

9191
![zsxq](/doc/pic/zsxq.jpg)
9292

93-
### 支付宝扫码捐赠
94-
95-
![donate-alipay](/doc/pic/donate-alipay.png)
96-
9793
### 微信支付捐赠
9894

9995
![donate-wechatpay](/doc/pic/donate-wechatpay.png)

Diff for: Release.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66

77
* Change the way to start the visitor through the command line from `frpc stcp --role=visitor xxx` to `frpc stcp visitor xxx`.
88
* Modified the semantics of the `server_addr` in the command line, no longer including the port. Added the `server_port` parameter to configure the port.
9+
* No longer support range ports mapping in TOML/YAML/JSON.

Diff for: conf/frpc.toml

+360
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,360 @@
1+
# your proxy name will be changed to {user}.{proxy}
2+
user = "your_name"
3+
4+
# A literal address or host name for IPv6 must be enclosed
5+
# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
6+
# For single serverAddr field, no need square brackets, like serverAddr = "::".
7+
serverAddr = "0.0.0.0"
8+
serverPort = 7000
9+
10+
# STUN server to help penetrate NAT hole.
11+
# natHoleStunServer = "stun.easyvoip.com:3478"
12+
13+
# Decide if exit program when first login failed, otherwise continuous relogin to frps
14+
# default is true
15+
loginFailExit = true
16+
17+
# console or real logFile path like ./frpc.log
18+
log.to = "./frpc.log"
19+
# trace, debug, info, warn, error
20+
log.level = "info"
21+
log.maxDays = 3
22+
# disable log colors when log.to is console, default is false
23+
log.disablePrintColor = false
24+
25+
auth.method = "token"
26+
# auth.additionalScopes specifies additional scopes to include authentication information.
27+
# Optional values are HeartBeats, NewWorkConns.
28+
# auth.additionalScopes = ["HeartBeats", "NewWorkConns"]
29+
30+
# auth token
31+
auth.token = "12345678"
32+
33+
# oidc.clientID specifies the client ID to use to get a token in OIDC authentication.
34+
# auth.oidc.clientID = ""
35+
# oidc.clientSecret specifies the client secret to use to get a token in OIDC authentication.
36+
# auth.oidc.clientSecret = ""
37+
# oidc.audience specifies the audience of the token in OIDC authentication.
38+
# auth.oidc.audience = ""
39+
# oidc_scope specifies the permisssions of the token in OIDC authentication if AuthenticationMethod == "oidc". By default, this value is "".
40+
# auth.oidc.scope = ""
41+
# oidc.tokenEndpointURL specifies the URL which implements OIDC Token Endpoint.
42+
# It will be used to get an OIDC token.
43+
# auth.oidc.tokenEndpointURL = ""
44+
45+
# oidc.additionalEndpointParams specifies additional parameters to be sent to the OIDC Token Endpoint.
46+
# For example, if you want to specify the "audience" parameter, you can set as follow.
47+
# frp will add "audience=<value>" "var1=<value>" to the additional parameters.
48+
# auth.oidc.additionalEndpointParams.audience = "https://dev.auth.com/api/v2/"
49+
# auth.oidc.additionalEndpointParams.var1 = "foobar"
50+
51+
# Set admin address for control frpc's action by http api such as reload
52+
webServer.addr = "127.0.0.1"
53+
webServer.port = 7400
54+
webServer.user = "admin"
55+
webServer.password = "admin"
56+
# Admin assets directory. By default, these assets are bundled with frpc.
57+
# webServer.assetsDir = "./static"
58+
59+
# Enable golang pprof handlers in admin listener.
60+
webServer.pprofEnable = false
61+
62+
# The maximum amount of time a dial to server will wait for a connect to complete. Default value is 10 seconds.
63+
# transport.dialServerTimeout = 10
64+
65+
# dialServerKeepalive specifies the interval between keep-alive probes for an active network connection between frpc and frps.
66+
# If negative, keep-alive probes are disabled.
67+
# transport.dialServerKeepalive = 7200
68+
69+
# connections will be established in advance, default value is zero
70+
transport.poolCount = 5
71+
72+
# If tcp stream multiplexing is used, default is true, it must be same with frps
73+
# transport.tcpMux = true
74+
75+
# Specify keep alive interval for tcp mux.
76+
# only valid if tcpMux is enabled.
77+
# transport.tcpMuxKeepaliveInterval = 60
78+
79+
# Communication protocol used to connect to server
80+
# supports tcp, kcp, quic, websocket and wss now, default is tcp
81+
transport.protocol = "tcp"
82+
83+
# set client binding ip when connect server, default is empty.
84+
# only when protocol = tcp or websocket, the value will be used.
85+
transport.connectServerLocalIP = "0.0.0.0"
86+
87+
# 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
88+
# it only works when protocol is tcp
89+
# transport.proxyURL = "http://user:[email protected]:8080"
90+
# transport.proxyURL = "socks5://user:[email protected]:1080"
91+
# transport.proxyURL = "ntlm://user:[email protected]:2080"
92+
93+
# quic protocol options
94+
# transport.quic.keepalivePeriod = 10
95+
# transport.quic.maxIdleTimeout = 30
96+
# transport.quic.maxIncomingStreams = 100000
97+
98+
# If tls.enable is true, frpc will connect frps by tls.
99+
# Since v0.50.0, the default value has been changed to true, and tls is enabled by default.
100+
transport.tls.enable = true
101+
102+
# transport.tls.certFile = "client.crt"
103+
# transport.tls.keyFile = "client.key"
104+
# transport.tls.trustedCaFile = "ca.crt"
105+
# transport.tls.serverName = "example.com"
106+
107+
# If the disableCustomTLSFirstByte is set to false, frpc will establish a connection with frps using the
108+
# first custom byte when tls is enabled.
109+
# Since v0.50.0, the default value has been changed to true, and the first custom byte is disabled by default.
110+
# transport.tls.disableCustomTLSFirstByte = true
111+
112+
# Heartbeat configure, it's not recommended to modify the default value.
113+
# The default value of heartbeat_interval is 10 and heartbeat_timeout is 90. Set negative value
114+
# to disable it.
115+
# transport.heartbeatInterval = 30
116+
# transport.heartbeatTimeout = 90
117+
118+
# Specify a dns server, so frpc will use this instead of default one
119+
# dnsServer = "8.8.8.8"
120+
121+
# Proxy names you want to start.
122+
# Default is empty, means all proxies.
123+
# start = ["ssh", "dns"]
124+
125+
# Specify udp packet size, unit is byte. If not set, the default value is 1500.
126+
# This parameter should be same between client and server.
127+
# It affects the udp and sudp proxy.
128+
udpPacketSize = 1500
129+
130+
# Additional metadatas for client.
131+
metadatas.var1 = "abc"
132+
metadatas.var2 = "123"
133+
134+
# Include other config files for proxies.
135+
# includes = ["./confd/*.ini"]
136+
137+
[[proxies]]
138+
# 'ssh' is the unique proxy name
139+
# If global user is not empty, it will be changed to {user}.{proxy} such as 'your_name.ssh'
140+
name = "ssh"
141+
type = "tcp"
142+
localIP = "127.0.0.1"
143+
localPort = 22
144+
# Limit bandwidth for this proxy, unit is KB and MB
145+
transport.bandwidthLimit = "1MB"
146+
# Where to limit bandwidth, can be 'client' or 'server', default is 'client'
147+
transport.bandwidthLimitMode = "client"
148+
# If true, traffic of this proxy will be encrypted, default is false
149+
transport.useEncryption = false
150+
# If true, traffic will be compressed
151+
transport.useCompression = false
152+
# Remote port listen by frps
153+
remotePort = 6001
154+
# frps will load balancing connections for proxies in same group
155+
loadBalancer.group = "test_group"
156+
# group should have same group key
157+
loadBalancer.groupKey = "123456"
158+
# Enable health check for the backend service, it supports 'tcp' and 'http' now.
159+
# frpc will connect local service's port to detect it's healthy status
160+
healthCheck.type = "tcp"
161+
# Health check connection timeout
162+
healthCheck.timeoutSeconds = 3
163+
# If continuous failed in 3 times, the proxy will be removed from frps
164+
healthCheck.maxFailed = 3
165+
# every 10 seconds will do a health check
166+
healthCheck.intervalSeconds = 10
167+
# additional meta info for each proxy
168+
metadatas.var1 = "abc"
169+
metadatas.var2 = "123"
170+
171+
[[proxies]]
172+
name = "ssh_random"
173+
type = "tcp"
174+
localIP = "192.168.31.100"
175+
localPort = 22
176+
# If remote_port is 0, frps will assign a random port for you
177+
remotePort = 0
178+
179+
[[proxies]]
180+
name = "dns"
181+
type = "udp"
182+
localIP = "114.114.114.114"
183+
localPort = 53
184+
remotePort = 6002
185+
186+
# 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
187+
[[proxies]]
188+
name = "web01"
189+
type = "http"
190+
localIP = "127.0.0.1"
191+
localPort = 80
192+
# http username and password are safety certification for http protocol
193+
# if not set, you can access this custom_domains without certification
194+
httpUser = "admin"
195+
httpPassword = "admin"
196+
# if domain for frps is frps.com, then you can access [web01] proxy by URL http://web01.frps.com
197+
subdomain = "web01"
198+
customDomains = ["web01.yourdomain.com"]
199+
# locations is only available for http type
200+
locations = ["/", "/pic"]
201+
# route requests to this service if http basic auto user is abc
202+
# route_by_http_user = abc
203+
hostHeaderRewrite = "example.com"
204+
# params with prefix "header_" will be used to update http request headers
205+
requestHeaders.set.x-from-where = "frp"
206+
healthCheck.type = "http"
207+
# frpc will send a GET http request '/status' to local http service
208+
# http service is alive when it return 2xx http response code
209+
healthCheck.path = "/status"
210+
healthCheck.intervalSeconds = 10
211+
healthCheck.maxFailed = 3
212+
healthCheck.timeoutSeconds = 3
213+
214+
[[proxies]]
215+
name = "web02"
216+
type = "https"
217+
localIP = "127.0.0.1"
218+
localPort = 8000
219+
subdomain = "web02"
220+
customDomains = ["web02.yourdomain.com"]
221+
# if not empty, frpc will use proxy protocol to transfer connection info to your local service
222+
# v1 or v2 or empty
223+
transport.proxyProtocolVersion = "v2"
224+
225+
[[proxies]]
226+
name = "tcpmuxhttpconnect"
227+
type = "tcpmux"
228+
multiplexer = "httpconnect"
229+
localIP = "127.0.0.1"
230+
localPort = 10701
231+
customDomains = ["tunnel1"]
232+
# routeByHTTPUser = "user1"
233+
234+
[[proxies]]
235+
name = "plugin_unix_domain_socket"
236+
type = "tcp"
237+
remotePort = 6003
238+
# if plugin is defined, local_ip and local_port is useless
239+
# plugin will handle connections got from frps
240+
[proxies.plugin]
241+
type = "unix_domain_socket"
242+
unixPath = "/var/run/docker.sock"
243+
244+
[[proxies]]
245+
name = "plugin_http_proxy"
246+
type = "tcp"
247+
remotePort = 6004
248+
[proxies.plugin]
249+
type = "http_proxy"
250+
httpUser = "abc"
251+
httpPassword = "abc"
252+
253+
[[proxies]]
254+
name = "plugin_socks5"
255+
type = "tcp"
256+
remotePort = 6005
257+
[proxies.plugin]
258+
type = "socks5"
259+
username = "abc"
260+
password = "abc"
261+
262+
[[proxies]]
263+
name = "plugin_static_file"
264+
type = "tcp"
265+
remotePort = 6006
266+
[proxies.plugin]
267+
type = "static_file"
268+
localPath = "/var/www/blog"
269+
stripPrefix = "static"
270+
httpUser = "abc"
271+
httpPassword = "abc"
272+
273+
[[proxies]]
274+
name = "plugin_https2http"
275+
type = "https"
276+
customDomains = ["test.yourdomain.com"]
277+
[proxies.plugin]
278+
type = "https2http"
279+
localAddr = "127.0.0.1:80"
280+
crtPath = "./server.crt"
281+
keyPath = "./server.key"
282+
hostHeaderRewrite = "127.0.0.1"
283+
requestHeaders.set.x-from-where = "frp"
284+
285+
[[proxies]]
286+
name = "plugin_https2https"
287+
type = "https"
288+
customDomains = ["test.yourdomain.com"]
289+
[proxies.plugin]
290+
type = "https2https"
291+
localAddr = "127.0.0.1:443"
292+
crtPath = "./server.crt"
293+
keyPath = "./server.key"
294+
hostHeaderRewrite = "127.0.0.1"
295+
requestHeaders.set.x-from-where = "frp"
296+
297+
[[proxies]]
298+
name = "plugin_http2https"
299+
type = "http"
300+
customDomains = ["test.yourdomain.com"]
301+
[proxies.plugin]
302+
type = "http2https"
303+
localAddr = "127.0.0.1:443"
304+
hostHeaderRewrite = "127.0.0.1"
305+
requestHeaders.set.x-from-where = "frp"
306+
307+
[[proxies]]
308+
name = "secret_tcp"
309+
# If the type is secret tcp, remote_port is useless
310+
# Who want to connect local port should deploy another frpc with stcp proxy and role is visitor
311+
type = "stcp"
312+
# secretKey is used for authentication for visitors
313+
secretKey = "abcdefg"
314+
localIP = "127.0.0.1"
315+
localPort = 22
316+
# If not empty, only visitors from specified users can connect.
317+
# Otherwise, visitors from same user can connect. '*' means allow all users.
318+
allowUsers = ["*"]
319+
320+
[[proxies]]
321+
name = "p2p_tcp"
322+
type = "xtcp"
323+
secretKey = "abcdefg"
324+
localIP = "127.0.0.1"
325+
localPort = 22
326+
# If not empty, only visitors from specified users can connect.
327+
# Otherwise, visitors from same user can connect. '*' means allow all users.
328+
allowUsers = ["user1", "user2"]
329+
330+
# frpc role visitor -> frps -> frpc role server
331+
[[visitors]]
332+
name = "secret_tcp_visitor"
333+
type = "stcp"
334+
# the server name you want to visitor
335+
serverName = "secret_tcp"
336+
secretKey = "abcdefg"
337+
# connect this address to visitor stcp server
338+
bindAddr = "127.0.0.1"
339+
# bindPort can be less than 0, it means don't bind to the port and only receive connections redirected from
340+
# other visitors. (This is not supported for SUDP now)
341+
bindPort = 9000
342+
343+
[[visitors]]
344+
name = "p2p_tcp_visitor"
345+
type = "xtcp"
346+
# if the server user is not set, it defaults to the current user
347+
serverUser = "user1"
348+
serverName = "p2p_tcp"
349+
secretKey = "abcdefg"
350+
bindAddr = "127.0.0.1"
351+
# bindPort can be less than 0, it means don't bind to the port and only receive connections redirected from
352+
# other visitors. (This is not supported for SUDP now)
353+
bindPort = 9001
354+
# when automatic tunnel persistence is required, set it to true
355+
keepTunnelOpen = false
356+
# effective when keep_tunnel_open is set to true, the number of attempts to punch through per hour
357+
maxRetriesAnHour = 8
358+
minRetryInterval = 90
359+
# fallbackTo = "stcp_visitor"
360+
# fallbackTimeoutMs = 500

0 commit comments

Comments
 (0)