当前位置:   article > 正文

frp配置文件详解_frpc配置文件

frpc配置文件
  1. frps

  1. # [common] is integral section
  2. [common]
  3. # 必须附上IPv6的文字地址或主机名
  4. # 在方括号中,如 "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
  5. # 对于单个 "bind_addr" 字段,不需要方括号,例如 "bind_addr = ::".
  6. bind_addr = 0.0.0.0
  7. bind_port = 7000
  8. # udp port to help make udp hole to penetrate nat
  9. bind_udp_port = 7001
  10. # udp port used for kcp protocol, it can be same with 'bind_port'
  11. # if not set, kcp is disabled in frps
  12. kcp_bind_port = 7000
  13. # specify which address proxy will listen for, default value is same with bind_addr
  14. # proxy_bind_addr = 127.0.0.1
  15. #如果您想支持虚拟主机,则必须设置用于侦听的http端口(可选)
  16. #注意:http端口和https端口可以与bind_端口相同
  17. vhost_http_port = 80
  18. vhost_https_port = 443
  19. # response header timeout(seconds) for vhost http server, default is 60s
  20. # vhost_http_timeout = 60
  21. # tcpmux_httpconnect_port specifies the port that the server listens for TCP
  22. # HTTP CONNECT requests. If the value is 0, the server will not multiplex TCP
  23. # requests on one single port. If it's not - it will listen on this value for
  24. # HTTP CONNECT requests. By default, this value is 0.
  25. # tcpmux_httpconnect_port = 1337
  26. # If tcpmux_passthrough is true, frps won't do any update on traffic.
  27. # tcpmux_passthrough = false
  28. # set dashboard_addr and dashboard_port to view dashboard of frps
  29. # dashboard_addr's default value is same with bind_addr
  30. # dashboard is available only if dashboard_port is set
  31. dashboard_addr = 0.0.0.0
  32. dashboard_port = 7500
  33. # dashboard user and passwd for basic auth protect
  34. dashboard_user = admin
  35. dashboard_pwd = admin
  36. # enable_prometheus will export prometheus metrics on {dashboard_addr}:{dashboard_port} in /metrics api.
  37. enable_prometheus = true
  38. # dashboard assets directory(only for debug mode)
  39. # assets_dir = ./static
  40. # console or real logFile path like ./frps.log
  41. log_file = ./frps.log
  42. # trace, debug, info, warn, error
  43. log_level = info
  44. log_max_days = 3
  45. # disable log colors when log_file is console, default is false
  46. disable_log_color = false
  47. # DetailedErrorsToClient defines whether to send the specific error (with debug info) to frpc. By default, this value is true.
  48. detailed_errors_to_client = true
  49. # authentication_method specifies what authentication method to use authenticate frpc with frps.
  50. # If "token" is specified - token will be read into login message.
  51. # If "oidc" is specified - OIDC (Open ID Connect) token will be issued using OIDC settings. By default, this value is "token".
  52. authentication_method = token
  53. # authenticate_heartbeats specifies whether to include authentication token in heartbeats sent to frps. By default, this value is false.
  54. authenticate_heartbeats = false
  55. # AuthenticateNewWorkConns specifies whether to include authentication token in new work connections sent to frps. By default, this value is false.
  56. authenticate_new_work_conns = false
  57. # auth token
  58. token = 12345678
  59. # oidc_issuer specifies the issuer to verify OIDC tokens with.
  60. # By default, this value is "".
  61. oidc_issuer =
  62. # oidc_audience specifies the audience OIDC tokens should contain when validated.
  63. # By default, this value is "".
  64. oidc_audience =
  65. # oidc_skip_expiry_check specifies whether to skip checking if the OIDC token is expired.
  66. # By default, this value is false.
  67. oidc_skip_expiry_check = false
  68. # oidc_skip_issuer_check specifies whether to skip checking if the OIDC token's issuer claim matches the issuer specified in OidcIssuer.
  69. # By default, this value is false.
  70. oidc_skip_issuer_check = false
  71. # heartbeat configure, it's not recommended to modify the default value
  72. # the default value of heartbeat_timeout is 90. Set negative value to disable it.
  73. # heartbeat_timeout = 90
  74. # user_conn_timeout configure, it's not recommended to modify the default value
  75. # the default value of user_conn_timeout is 10
  76. # user_conn_timeout = 10
  77. # only allow frpc to bind ports you list, if you set nothing, there won't be any limit
  78. allow_ports = 2000-3000,3001,3003,4000-50000
  79. # pool_count in each proxy will change to max_pool_count if they exceed the maximum value
  80. max_pool_count = 5
  81. # max ports can be used for each client, default value is 0 means no limit
  82. max_ports_per_client = 0
  83. # tls_only specifies whether to only accept TLS-encrypted connections. By default, the value is false.
  84. tls_only = false
  85. # tls_cert_file = server.crt
  86. # tls_key_file = server.key
  87. # tls_trusted_ca_file = ca.crt
  88. # if subdomain_host is not empty, you can set subdomain when type is http or https in frpc's configure file
  89. # when subdomain is test, the host used by routing is test.frps.com
  90. subdomain_host = frps.com
  91. # if tcp stream multiplexing is used, default is true
  92. # tcp_mux = true
  93. # specify keep alive interval for tcp mux.
  94. # only valid if tcp_mux is true.
  95. # tcp_mux_keepalive_interval = 60
  96. # tcp_keepalive specifies the interval between keep-alive probes for an active network connection between frpc and frps.
  97. # If negative, keep-alive probes are disabled.
  98. # tcp_keepalive = 7200
  99. # custom 404 page for HTTP requests
  100. # custom_404_page = /path/to/404.html
  101. # specify udp packet size, unit is byte. If not set, the default value is 1500.
  102. # This parameter should be same between client and server.
  103. # It affects the udp and sudp proxy.
  104. udp_packet_size = 1500
  105. # Enable golang pprof handlers in dashboard listener.
  106. # Dashboard port must be set first
  107. pprof_enable = false
  108. [plugin.user-manager]
  109. addr = 127.0.0.1:9000
  110. path = /handler
  111. ops = Login
  112. [plugin.port-manager]
  113. addr = 127.0.0.1:9001
  114. path = /handler
  115. ops = NewProxy
  1. frpc

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/161304
推荐阅读
  

闽ICP备14008679号