[common]
# 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"
bind_addr = 0.0.0.0
bind_port = 7000
# udp port used for kcp protocol, it can be same with 'bind_port'
# if not set, kcp is disabled in frps
kcp_bind_port = 7000
# udp port to help make udp hole to penetrate nat
bind_udp_port = 7001
dashboard_addr = 0.0.0.0
dashboard_port = 7500
# dashboard user and passwd for basic auth protect, if not set, both default value is admin
dashboard_user = admin
dashboard_pwd = 098766551
# AuthenticationMethod specifies what authentication method to use authenticate frpc with frps.
# If "token" is specified - token will be read into login message.
# If "oidc" is specified - OIDC (Open ID Connect) token will be issued using OIDC settings. By default, this value is "token".
authentication_method = token
# auth token
token = fgs4321fewfrew42432
# if tcp stream multiplexing is used, default is true
tcp_mux = true
# only allow frpc to bind ports you list, if you set nothing, there won't be any limit
allow_ports = 8123
# trace, debug, info, warn, error
log_level = warn
然后本地frpc.ini的配置如下
[common]
# 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"
server_addr = www.domain.com # 服务器IP
server_port = 7000
# for authentication
token = fgs4321fewfrew42432
# decide if exit program when first login failed, otherwise continuous relogin to frps
# default is true
login_fail_exit = true
# now it supports tcp and kcp and websocket, default is tcp
protocol = kcp
# if tls_enable is true, frpc will connect frps by tls
tls_enable = true
[home_assistant]
# tcp | udp | http | https | stcp | xtcp, default is tcp
type = tcp
local_ip = 127.0.0.1
local_port = 18123
# remote port listen by frps
remote_port = 8123