frp客户端配置大全
来源:自通100 发布时间:2024-07-06 17:57:51 浏览:15
#此配置文件仅供参考。请不要直接使用此配置来运行程序,因为它可能存在各种问题。
#您的代理名称将更改为{user}。代理
user=“your_name”
#IPv6的文字地址或主机名必须包含在内
#方括号中,如“[::1]:80”、“[ipv6-host]:http”或“[ipv6host%zone]:80”
#对于单个serverAddr字段,不需要方括号,如serverAddr=“:”。
serverAddr=“0.0.0.0”
服务器端口=7000
#STUN服务器帮助穿透NAT漏洞。
#natHoleStunServer=“stun.easyvoip.com:3478”
#决定第一次登录失败时是否退出程序,否则继续重新登录到frps
#默认为true
loginFailExit=true
#控制台或真实的logFile路径类似/frpc日志
log.to=“./frpc.log”
#跟踪、调试、信息、警告、错误
log.level=“信息”
log.max天=3
#当log.to为控制台时禁用日志颜色,默认值为false
log.disablePrintColor=false
auth.method=“令牌”
#auth.additionalScopes指定要包括身份验证信息的其他作用域。
#可选值为HeartBeats、NewWorkConns。
#auth.additionalScopes=[“心跳”,“NewWorkConns”]
#身份验证令牌
auth.token=“12345678”
#oidc.clientID指定用于在oidc身份验证中获取令牌的客户端ID。
#auth.oidc.clientID=“”
#oidc.clientSecret指定用于在oidc身份验证中获取令牌的客户端机密。
#auth.oidc.clientSecret=“”
#oidc.audience指定oidc身份验证中令牌的受众。
#auth.oidc.audience=“”
#如果AuthenticationMethod==“oidc”,则oidc.scope指定oidc身份验证中令牌的权限。默认情况下,此值为“”。
#auth.oidc.scope=“”
#oidc.tokenEndpointURL指定实现oidc令牌端点的URL。
#它将用于获取OIDC令牌。
#auth.oidc.tokenEndpointURL=“”
#oidc.additionalEndpointParams指定要发送到oidc令牌端点的其他参数。
#例如,如果要指定“访问群体”参数,可以按如下方式进行设置。
#frp将在附加参数中添加“audience=
#auth.oidc.additionalEndpointParams.audience=“https://dev.auth.com/api/v2/"
#auth.oidc.additionalEndpointParams.var1=“foobar”
#通过http api(如reload)为控制frpc的操作设置管理地址
webServer.addr=“127.0.0.1”
webServer.port=7400
webServer.user=“admin”
webServer.password=“admin”
#管理资产目录。默认情况下,这些资产与frpc捆绑在一起。
#webServer.assetsDir=“./static”
#在管理侦听器中启用golang-prof处理程序。
webServer.pprofEnable=false
#拨号到服务器等待连接完成的最长时间。默认值为10秒。
#transport.dialServerTimeout=10
#dialServerKeepalive指定frpc和frps之间活动网络连接的保持活动探测之间的间隔。
#如果为阴性,则禁用保活探针。
#transport.dialServerKeepalive=7200
#连接将提前建立,默认值为零
transport.pool计数=5
#如果使用tcp流复用,默认值为true,则必须与frps相同
#transport.tcpMux=true
#指定tcp mux的保持活动间隔。
#仅当tcpMux已启用时有效。
#transport.tcpMuxKeepaliveInterval=30
#用于连接到服务器的通信协议
#现在支持tcp、kcp、quic、websocket和wss,默认为tcp
transport.procol=“tcp”
#在连接服务器时设置客户端绑定ip,默认为空。
#只有当protocol=tcp或websocket时,才会使用该值。
transport.connectServerLocalIP=“0.0.0.0”
#如果要通过http代理、socks5代理或ntlm代理连接frps,可以在此处或全局环境变量中设置proxyURL
#它只在协议为tcp时工作
#transport.proxyURL=“http://user:passwd@192.168.1.128:8080"
#transport.proxyURL=“socks5://用户:passwd@192.168.1.128:1080"
#transport.proxyURL=“ntlm://user:passwd@192.168.1.128:2080"
#quic协议选项
#transport.quic.keepalivePeriod=10
#transport.quic.maxIdleTimeout=30
#transport.quic.maxIncomingStreams=100000
#如果tls.enable为true,则frpc将通过tls连接frps。
#自v0.50.0以来,默认值已更改为true,并且默认情况下启用tls。
transport.tls.enable=真
#transport.tls.cortFile=“client.crt”
#transport.tls.keyFile=“client.key”
#transport.tlstrustedCaFile=“ca.crt”
#transport.tls.serverName=“example.com”
#如果disableCustomTLSFirstByte设置为false,则frpc将使用
#启用tls时的第一个自定义字节。
#自v0.50.0以来,默认值已更改为true,并且默认情况下禁用第一个自定义字节。
#transport.tls.disableCustomTLSFirstByte=true
#心跳配置,不建议修改默认值。
#heartbeatInterval的默认值为10,heartbeatTimeout为90。设置负值
#以禁用它。
#transport.theartheat间隔=30
#transport.theartbeatTimeout=90
#指定一个dns服务器,因此frpc将使用此服务器而不是默认服务器
#dnsServer=“8.8.8.8”
#要启动的代理名称。
#默认值为空,表示所有代理。
#start=[“ssh”,“dns”]
#指定udp数据包大小,单位为字节。如果未设置,则默认值为1500。
#此参数在客户端和服务器之间应该相同。
#它会影响udp和sudp代理。
udp数据包大小=1500
#客户端的其他元数据。
元数据.var1=“abc”
元数据.var2=“123”
#包括代理的其他配置文件。
#includes=[“./confd/*.ini”]
[[代理人]]
#“ssh”是唯一的代理名称
#如果全局用户不为空,它将被更改为{user}。{proxy},如“your_name.ssh”
name=“ssh”
type=“tcp”
localIP=“127.0.0.1”
localPort=22
#限制此代理的带宽,单位为KB和MB
transport.bwidthLimit=“1MB”
#限制带宽的位置,可以是“客户端”或“服务器”,默认为“客户端”
transport.bwidthLimitMode=“客户端”
#如果为true,则此代理的流量将被加密,默认为false
transport.useEncryption=false
#如果为true,则流量将被压缩
transport.useCompression=false
#通过frp进行远程端口侦听
remotePort=6001
#frp将对同一组中的代理进行负载平衡连接
loadBalancer.group=“test_group”
#组应具有相同的组密钥
loadBalancer.groupKey=“123456”
#启用后端服务的健康检查,它现在支持“tcp”和“http”。
#frpc将连接本地服务的端口以检测其健康状态
healthCheck.type=“tcp”
#健康检查连接超时
healthCheck.timeoutSeconds=3
#如果连续3次失败,代理将从frps中删除
healthCheck.maxFailed=3
#每10秒进行一次健康检查
healthCheck.intervalSeconds=10
#每个代理的附加元信息。它将被传递给服务器端插件使用。
元数据.var1=“abc”
元数据.var2=“123”
#您可以通过注释向代理添加一些额外信息。
#这些注释将显示在frps面板上。
[代理.注释]
key1=“值1”
“prefix/key2”=“value2”
[[代理人]]
name=“ssh_random”
type=“tcp”
localIP=“192.168.31.100”
localPort=22
#如果remotePort为0,frps将为您分配一个随机端口
remotePort=0
[[代理人]]
name=“dns”
type=“udp”
localIP=“114.114.114.114”
localPort=53
remotePort=6002
#将域名解析到[serverAddr],以便使用http://web01.yourdomain.com浏览web01和http://web02.yourdomain.com浏览web02
[[代理人]]
name=“web01”
type=“http”
localIP=“127.0.0.1”
localPort=80
#http用户名和密码是http协议的安全认证
#如果未设置,则无需证书即可访问此customDomains
httpUser=“admin”
httpPassword=“admin”
#如果frps的域是frps.com,那么您可以通过URL访问[web01]代理http://web01.frps.com
subdomain=“web01”
customDomains=[“web01.yourdomain.com”]
#位置仅适用于http类型
locations=[“/”,“/pic”]
#如果http基本自动用户是abc,则将请求路由到此服务
#routeByHTTPUser=abc
hostHeaderRewrite=“example.com”
requestHeaders.set.x-from-where=“frp”
responseHeaders.set.foo=“bar”
healthCheck.type=“http”
#frpc将向本地http服务发送GET http请求“/status”
#http服务在返回2xx http响应代码时处于活动状态
healthCheck.path=“/status”
healthCheck.intervalSeconds=10
healthCheck.maxFailed=3
healthCheck.timeoutSeconds=3
#设置运行状况检查标头
healthCheck.httpHeaders=[
{name=“x-from-where”,value=“frp”}
]
[[代理人]]
name=“web02”
type=“https”
localIP=“127.0.0.1”
localPort=8000
subdomain=“web02”
customDomains=[“web02.yourdomain.com”]
#如果不为空,frpc将使用代理协议将连接信息传输到您的本地服务
#v1或v2或为空
transport.proxyProtocolVersion=“v2”
[[代理人]]
name=“tcpmuxhttpconnect”
type=“tcpmux”
multiplexer=“httpconnect”
localIP=“127.0.0.1”
localPort=10701
customDomains=[“tunnel1”]
#routeByHTTPUser=“user1”
[[代理人]]
name=“plugin_unix_domain_socket”
type=“tcp”
remotePort=6003
#如果定义了插件,localIP和localPort就没用了
#插件将处理从frps获得的连接
[代理插件]
type=“unix_domain_socket”
unixPath=“/var/run/docker.sock”
[[代理人]]
name=“plugin_http_proxy”
type=“tcp”
remotePort=6004
[代理插件]
type=“http_proxy”
httpUser=“abc”
httpPassword=“abc”
[[代理人]]
name=“plugin_socks5”
type=“tcp”
remotePort=6005
[代理插件]
type=“socks5”
username=“abc”
password=“abc”
[[代理人]]
name=“plugin_static_file”
type=“tcp”
remotePort=6006
[代理插件]
type=“static_file”
localPath=“/var/www/blog”
stripPrefix=“静态”
httpUser=“abc”
httpPassword=“abc”
[[代理人]]
name=“plugin_https2http”
type=“https”
customDomains=[“test.yourdomain.com”]
[代理插件]
type=“https2http”
localAddr=“127.0.0.1:80”
crtPath=“./server.crt”
keyPath=“./server.key”
hostHeaderRewrite=“127.0.0.1”
requestHeaders.set.x-from-where=“frp”
[[代理人]]
name=“plugin_https2https”
type=“https”
customDomains=[“test.yourdomain.com”]
[代理插件]
type=“https2https”
localAddr=“127.0.0.1:443”
crtPath=“./server.crt”
keyPath=“./server.key”
hostHeaderRewrite=“127.0.0.1”
requestHeaders.set.x-from-where=“frp”
[[代理人]]
name=“plugin_http2https”
type=“http”
customDomains=[“test.yourdomain.com”]
[代理插件]
type=“http2https”
localAddr=“127.0.0.1:443”
hostHeaderRewrite=“127.0.0.1”
requestHeaders.set.x-from-where=“frp”
[[代理人]]
name=“plugin_http2http”
type=“tcp”
remotePort=6007
[代理插件]
type=“http2http”
localAddr=“127.0.0.1:80”
hostHeaderRewrite=“127.0.0.1”
requestHeaders.set.x-from-where=“frp”
[[代理人]]
name=“secret_tcp”
#如果类型是secret tcp,则remotePort无效
#想要连接本地端口的人应该部署另一个带有stcp代理的frpc,并且角色是访问者
type=“stcp”
#secretKey用于访问者的身份验证
secretKey=“abcdefg”
localIP=“127.0.0.1”
localPort=22
#如果不为空,则只有来自指定用户的访问者才能连接。
#否则,来自同一用户的访问者可以连接。'*'意味着允许所有用户。
allowUsers=[“*”]
[[代理人]]
name=“p2p_tcp”
type=“xtcp”
secretKey=“abcdefg”
localIP=“127.0.0.1”
localPort=22
#如果不为空,则只有来自指定用户的访问者才能连接。
#否则,来自同一用户的访问者可以连接。'*'意味着允许所有用户。
allowUsers=[“user1”,“user2”]
#frpc角色访问者->frps->frpc角色服务器
[[访客]]
name=“secret_tcp_visitor”
type=“stcp”
#要访问的服务器名称
serverName=“secret_tcp”
secretKey=“abcdefg”
#将此地址连接到访问者stcp服务器
bindAddr=“127.0.0.1”
#bindPort可以小于0,这意味着不绑定到端口,只接收重定向的连接
#其他访客。(SUDP现在不支持此功能)
bindPort=9000
[[访客]]
name=“p2p_tcp_visitor”
type=“xtcp”
#如果未设置服务器用户,则默认为当前用户
serverUser=“user1”
serverName=“p2p_tcp”
secretKey=“abcdefg”
bindAddr=“127.0.0.1”
#bindPort可以小于0,这意味着不绑定到端口,只接收重定向的连接
#其他访客。(SUDP现在不支持此功能)
bindPort=9001
#当需要自动隧道持久性时,将其设置为true
keepTunnelOpen=false
#当keepTunnelOpen设置为true时有效,即每小时打卡的尝试次数
每小时最大重试次数=8
minRetryInterval=90
#fallbackTo=“stcp_visitor”
#fallbackTimeoutMs=500