frpc_legacy_full.ini 12 KB

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