frpc_full.ini 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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. # 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
  9. # it only works when protocol is tcp
  10. # http_proxy = http://user:passwd@192.168.1.128:8080
  11. # http_proxy = socks5://user:passwd@192.168.1.128:1080
  12. # http_proxy = ntlm://user:passwd@192.168.1.128:2080
  13. # console or real logFile path like ./frpc.log
  14. log_file = ./frpc.log
  15. # trace, debug, info, warn, error
  16. log_level = info
  17. log_max_days = 3
  18. # disable log colors when log_file is console, default is false
  19. disable_log_color = false
  20. # for authentication, should be same as your frps.ini
  21. # authenticate_heartbeats specifies whether to include authentication token in heartbeats sent to frps. By default, this value is false.
  22. authenticate_heartbeats = false
  23. # authenticate_new_work_conns specifies whether to include authentication token in new work connections sent to frps. By default, this value is false.
  24. authenticate_new_work_conns = false
  25. # auth token
  26. token = 12345678
  27. # oidc_client_id specifies the client ID to use to get a token in OIDC authentication if AuthenticationMethod == "oidc".
  28. # By default, this value is "".
  29. oidc_client_id =
  30. # oidc_client_secret specifies the client secret to use to get a token in OIDC authentication if AuthenticationMethod == "oidc".
  31. # By default, this value is "".
  32. oidc_client_secret =
  33. # oidc_audience specifies the audience of the token in OIDC authentication if AuthenticationMethod == "oidc". By default, this value is "".
  34. oidc_audience =
  35. # oidc_token_endpoint_url specifies the URL which implements OIDC Token Endpoint.
  36. # It will be used to get an OIDC token if AuthenticationMethod == "oidc". By default, this value is "".
  37. oidc_token_endpoint_url =
  38. # set admin address for control frpc's action by http api such as reload
  39. admin_addr = 127.0.0.1
  40. admin_port = 7400
  41. admin_user = admin
  42. admin_pwd = admin
  43. # Admin assets directory. By default, these assets are bundled with frpc.
  44. # assets_dir = ./static
  45. # connections will be established in advance, default value is zero
  46. pool_count = 5
  47. # if tcp stream multiplexing is used, default is true, it must be same with frps
  48. tcp_mux = true
  49. # your proxy name will be changed to {user}.{proxy}
  50. user = your_name
  51. # decide if exit program when first login failed, otherwise continuous relogin to frps
  52. # default is true
  53. login_fail_exit = true
  54. # communication protocol used to connect to server
  55. # now it supports tcp, kcp and websocket, default is tcp
  56. protocol = tcp
  57. # if tls_enable is true, frpc will connect frps by tls
  58. tls_enable = true
  59. # tls_cert_file = client.crt
  60. # tls_key_file = client.key
  61. # tls_trusted_ca_file = ca.crt
  62. # tls_server_name = example.com
  63. # specify a dns server, so frpc will use this instead of default one
  64. # dns_server = 8.8.8.8
  65. # proxy names you want to start seperated by ','
  66. # default is empty, means all proxies
  67. # start = ssh,dns
  68. # heartbeat configure, it's not recommended to modify the default value
  69. # the default value of heartbeat_interval is 10 and heartbeat_timeout is 90
  70. # heartbeat_interval = 30
  71. # heartbeat_timeout = 90
  72. # additional meta info for client
  73. meta_var1 = 123
  74. meta_var2 = 234
  75. # specify udp packet size, unit is byte. If not set, the default value is 1500.
  76. # This parameter should be same between client and server.
  77. # It affects the udp and sudp proxy.
  78. udp_packet_size = 1500
  79. # include other config files for proxies.
  80. # includes = ./confd/*.ini
  81. # 'ssh' is the unique proxy name
  82. # if user in [common] section is not empty, it will be changed to {user}.{proxy} such as 'your_name.ssh'
  83. [ssh]
  84. # tcp | udp | http | https | stcp | xtcp, default is tcp
  85. type = tcp
  86. local_ip = 127.0.0.1
  87. local_port = 22
  88. # limit bandwidth for this proxy, unit is KB and MB
  89. bandwidth_limit = 1MB
  90. # true or false, if true, messages between frps and frpc will be encrypted, default is false
  91. use_encryption = false
  92. # if true, message will be compressed
  93. use_compression = false
  94. # remote port listen by frps
  95. remote_port = 6001
  96. # frps will load balancing connections for proxies in same group
  97. group = test_group
  98. # group should have same group key
  99. group_key = 123456
  100. # enable health check for the backend service, it support 'tcp' and 'http' now
  101. # frpc will connect local service's port to detect it's healthy status
  102. health_check_type = tcp
  103. # health check connection timeout
  104. health_check_timeout_s = 3
  105. # if continuous failed in 3 times, the proxy will be removed from frps
  106. health_check_max_failed = 3
  107. # every 10 seconds will do a health check
  108. health_check_interval_s = 10
  109. # additional meta info for each proxy
  110. meta_var1 = 123
  111. meta_var2 = 234
  112. [ssh_random]
  113. type = tcp
  114. local_ip = 127.0.0.1
  115. local_port = 22
  116. # if remote_port is 0, frps will assign a random port for you
  117. remote_port = 0
  118. # if you want to expose multiple ports, add 'range:' prefix to the section name
  119. # frpc will generate multiple proxies such as 'tcp_port_6010', 'tcp_port_6011' and so on.
  120. [range:tcp_port]
  121. type = tcp
  122. local_ip = 127.0.0.1
  123. local_port = 6010-6020,6022,6024-6028
  124. remote_port = 6010-6020,6022,6024-6028
  125. use_encryption = false
  126. use_compression = false
  127. [dns]
  128. type = udp
  129. local_ip = 114.114.114.114
  130. local_port = 53
  131. remote_port = 6002
  132. use_encryption = false
  133. use_compression = false
  134. [range:udp_port]
  135. type = udp
  136. local_ip = 127.0.0.1
  137. local_port = 6010-6020
  138. remote_port = 6010-6020
  139. use_encryption = false
  140. use_compression = false
  141. # 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
  142. [web01]
  143. type = http
  144. local_ip = 127.0.0.1
  145. local_port = 80
  146. use_encryption = false
  147. use_compression = true
  148. # http username and password are safety certification for http protocol
  149. # if not set, you can access this custom_domains without certification
  150. http_user = admin
  151. http_pwd = admin
  152. # if domain for frps is frps.com, then you can access [web01] proxy by URL http://test.frps.com
  153. subdomain = web01
  154. custom_domains = web02.yourdomain.com
  155. # locations is only available for http type
  156. locations = /,/pic
  157. host_header_rewrite = example.com
  158. # params with prefix "header_" will be used to update http request headers
  159. header_X-From-Where = frp
  160. health_check_type = http
  161. # frpc will send a GET http request '/status' to local http service
  162. # http service is alive when it return 2xx http response code
  163. health_check_url = /status
  164. health_check_interval_s = 10
  165. health_check_max_failed = 3
  166. health_check_timeout_s = 3
  167. [web02]
  168. type = https
  169. local_ip = 127.0.0.1
  170. local_port = 8000
  171. use_encryption = false
  172. use_compression = false
  173. subdomain = web01
  174. custom_domains = web02.yourdomain.com
  175. # if not empty, frpc will use proxy protocol to transfer connection info to your local service
  176. # v1 or v2 or empty
  177. proxy_protocol_version = v2
  178. [plugin_unix_domain_socket]
  179. type = tcp
  180. remote_port = 6003
  181. # if plugin is defined, local_ip and local_port is useless
  182. # plugin will handle connections got from frps
  183. plugin = unix_domain_socket
  184. # params with prefix "plugin_" that plugin needed
  185. plugin_unix_path = /var/run/docker.sock
  186. [plugin_http_proxy]
  187. type = tcp
  188. remote_port = 6004
  189. plugin = http_proxy
  190. plugin_http_user = abc
  191. plugin_http_passwd = abc
  192. [plugin_socks5]
  193. type = tcp
  194. remote_port = 6005
  195. plugin = socks5
  196. plugin_user = abc
  197. plugin_passwd = abc
  198. [plugin_static_file]
  199. type = tcp
  200. remote_port = 6006
  201. plugin = static_file
  202. plugin_local_path = /var/www/blog
  203. plugin_strip_prefix = static
  204. plugin_http_user = abc
  205. plugin_http_passwd = abc
  206. [plugin_https2http]
  207. type = https
  208. custom_domains = test.yourdomain.com
  209. plugin = https2http
  210. plugin_local_addr = 127.0.0.1:80
  211. plugin_crt_path = ./server.crt
  212. plugin_key_path = ./server.key
  213. plugin_host_header_rewrite = 127.0.0.1
  214. plugin_header_X-From-Where = frp
  215. [plugin_https2https]
  216. type = https
  217. custom_domains = test.yourdomain.com
  218. plugin = https2https
  219. plugin_local_addr = 127.0.0.1:443
  220. plugin_crt_path = ./server.crt
  221. plugin_key_path = ./server.key
  222. plugin_host_header_rewrite = 127.0.0.1
  223. plugin_header_X-From-Where = frp
  224. [plugin_http2https]
  225. type = http
  226. custom_domains = test.yourdomain.com
  227. plugin = http2https
  228. plugin_local_addr = 127.0.0.1:443
  229. plugin_host_header_rewrite = 127.0.0.1
  230. plugin_header_X-From-Where = frp
  231. [secret_tcp]
  232. # If the type is secret tcp, remote_port is useless
  233. # Who want to connect local port should deploy another frpc with stcp proxy and role is visitor
  234. type = stcp
  235. # sk used for authentication for visitors
  236. sk = abcdefg
  237. local_ip = 127.0.0.1
  238. local_port = 22
  239. use_encryption = false
  240. use_compression = false
  241. # user of frpc should be same in both stcp server and stcp visitor
  242. [secret_tcp_visitor]
  243. # frpc role visitor -> frps -> frpc role server
  244. role = visitor
  245. type = stcp
  246. # the server name you want to visitor
  247. server_name = secret_tcp
  248. sk = abcdefg
  249. # connect this address to visitor stcp server
  250. bind_addr = 127.0.0.1
  251. bind_port = 9000
  252. use_encryption = false
  253. use_compression = false
  254. [p2p_tcp]
  255. type = xtcp
  256. sk = abcdefg
  257. local_ip = 127.0.0.1
  258. local_port = 22
  259. use_encryption = false
  260. use_compression = false
  261. [p2p_tcp_visitor]
  262. role = visitor
  263. type = xtcp
  264. server_name = p2p_tcp
  265. sk = abcdefg
  266. bind_addr = 127.0.0.1
  267. bind_port = 9001
  268. use_encryption = false
  269. use_compression = false
  270. [tcpmuxhttpconnect]
  271. type = tcpmux
  272. multiplexer = httpconnect
  273. local_ip = 127.0.0.1
  274. local_port = 10701
  275. custom_domains = tunnel1