<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>参考 on frp</title>
    <link>/zh-cn/docs/reference/</link>
    <description>Recent content in 参考 on frp</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <atom:link href="/zh-cn/docs/reference/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>通用配置</title>
      <link>/zh-cn/docs/reference/common/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/zh-cn/docs/reference/common/</guid>
      <description>LogConfig Field Type Description Required to string 日志输出文件路径，如果为 console，则会将日志打印在标准输出中。 No level string 日志级别，可选值为 trace, debug, info, warn, error，默认级别为 info。 No maxDays int 日志文件最多保留天数，默认为 3 天。 No disablePrintColor bool 禁用标准输出中的日志颜色。 No WebServerConfig Field Type Description Required addr string webServer 监听地址，默认为 127.0.0.1。 No port int webServer 监听端口。 Yes user string HTTP BasicAuth 用户名。 No password string HTTP BasicAuth 密码。 No assetsDir string 静态资源目录，Dashboard 使用的资源默认打包在二进制文件中，通过指定此参数使用自定义的静态资源。 No pprofEnable bool 启动 Go HTTP pprof，用于应用调试。 No tls TLSConfig Dashboard 启用 HTTPS 的 TLS 相关配置。 No TLSConfig Field Type Description Required certFile string TLS 证书文件路径。 Yes keyFile string TLS 密钥文件路径。 Yes trustedCaFile string CA 证书文件路径。 No serverName string TLS Server 名称。 No QUICOptions Field Type Description Required keepalivePeriod int 默认值为 10 秒。 No maxIdleTimeout int 默认值为 30 秒。 No maxIncomingStreams int 默认值为 100000。 No PortsRange Field Type Description Required start int 起始端口。 No end int 终止端口。 No single int 单一端口。 No HeaderOperations Field Type Description Required set map[string]string 在 Header 中设置指定的 KV 值。 No HTTPHeader Field Type Description Required name string Header 名称。 Yes value string Header 值。 Yes ValueSource Field Type Description Required type string 数据源类型，可选值为 &amp;ldquo;file&amp;rdquo; 和 &amp;ldquo;exec&amp;rdquo;。 Yes file FileSource 文件数据源配置，当 type 为 &amp;ldquo;file&amp;rdquo; 时必填。 No exec ExecSource 外部命令数据源配置，当 type 为 &amp;ldquo;exec&amp;rdquo; 时必填。需要启动时添加 --allow-unsafe=TokenSourceExec 参数。 No FileSource Field Type Description Required path string 文件路径。 Yes ExecSource Field Type Description Required command string 要执行的命令路径。 Yes args []string 命令参数列表。 No env []ExecEnvVar 额外的环境变量。 No ExecEnvVar Field Type Description Required name string 环境变量名称。 Yes value string 环境变量值。 Yes NatTraversalConfig Field Type Description Required disableAssistedAddrs bool 禁用本地网络接口地址的辅助连接。当启用时，仅使用通过 STUN 发现的公网地址进行 NAT 打洞，避免使用可能较慢的本地网络接口（如 VPN）。默认为 false。 No </description>
    </item>
    <item>
      <title>服务端配置</title>
      <link>/zh-cn/docs/reference/server-configures/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/zh-cn/docs/reference/server-configures/</guid>
      <description>ServerConfig Field Type Description Required auth AuthServerConfig 鉴权配置。 No bindAddr string 服务端监听地址，用于接收 frpc 的连接，默认监听 0.0.0.0。 No bindPort int 服务端监听端口，默认值为 7000。 No kcpBindPort int 服务端监听 KCP 协议端口，用于接收配置了使用 KCP 协议的 frpc 连接。 No quicBindPort int 服务端监听 QUIC 协议端口，用于接收配置了使用 QUIC 协议的 frpc 连接。 No proxyBindAddr string 代理监听地址，可以使代理监听在不同的网卡地址，默认情况下同 bindAddr。 No vhostHTTPPort int HTTP 类型代理监听的端口，启用后才能支持 HTTP 类型的代理。 No vhostHTTPTimeout int HTTP 类型代理在服务端的 ResponseHeader 超时时间，默认为 60s。 No vhostHTTPSPort int HTTPS 类型代理监听的端口，启用后才能支持 HTTPS 类型的代理。 No tcpmuxHTTPConnectPort int tcpmux 类型且复用器为 httpconnect 的代理监听的端口。 No tcpmuxPassthrough bool 对于 tcpmux 类型的代理是否透传 CONNECT 请求。 No subDomainHost string 二级域名后缀。 No custom404Page string 自定义 404 错误页面地址。 No sshTunnelGateway SSHTunnelGateway ssh 隧道网关配置。 No webServer WebServerConfig 服务端 Dashboard 配置。 No enablePrometheus bool 是否提供 Prometheus 监控接口，需要同时启用了 webServer 后才会生效。 No log LogConfig 日志配置。 No transport ServerTransportConfig 网络层配置。 No detailedErrorsToClient bool 服务端返回详细错误信息给客户端，默认为 true。 No maxPortsPerClient int 限制单个客户端最大同时存在的代理数，默认无限制。 No userConnTimeout int 用户建立连接后等待客户端响应的超时时间，单位秒，默认为 10 秒。 No udpPacketSize int 代理 UDP 服务时支持的最大包长度，默认为 1500，服务端和客户端的值需要一致。 No natholeAnalysisDataReserveHours int 打洞策略数据的保留时间，默认为 168 小时，即 7 天。 No allowPorts []PortsRange 允许代理绑定的服务端端口。 No httpPlugins []HTTPPluginOptions 服务端 HTTP 插件配置。 No AuthServerConfig Field Type Description Required method string 鉴权方式，可选值为 token 或 oidc，默认为 token。 No additionalScopes []string 鉴权信息附加范围，可选值为 HeartBeats 和 NewWorkConns No token string 在 method 为 token 时生效，客户端需要设置一样的值才能鉴权通过。与 tokenSource 字段互斥。 No tokenSource ValueSource 从文件中加载 token 的配置。与 token 字段互斥。 No oidc AuthOIDCServerConfig oidc 鉴权配置。 No AuthOIDCServerConfig Field Type Description Required issuer string No audience string No skipExpiryCheck bool No skipIssuerCheck bool No ServerTransportConfig Field Type Description Required tcpMuxKeepaliveInterval int tcp mux 的心跳检查间隔时间，单位秒。 No tcpKeepalive int 和客户端底层 TCP 连接的 keepalive 间隔时间，单位秒，配置为负数表示不启用。 No maxPoolCount int 允许客户端设置的最大连接池大小，如果客户端配置的值大于此值，会被强制修改为最大值，默认为 5。 No heartbeatTimeout int 服务端和客户端心跳连接的超时时间，单位秒，默认为 90 秒。 No quic QUICOptions QUIC 协议配置参数。 No tls TLSServerConfig 服务端 TLS 协议配置。 No TLSServerConfig Field Type Description Required force bool 是否只接受启用了 TLS 的客户端连接。 No TLSConfig TLS 协议配置，内嵌结构。 No HTTPPluginOptions Field Type Description Required name string 插件名称。 Yes addr string 插件接口的地址。 Yes path string 插件接口的 Path。 Yes ops []string 插件需要生效的操作列表，具体可选值请参考服务端插件的说明文档。 Yes tlsVerify bool 当插件地址为 HTTPS 协议时，是否校验插件的 TLS 证书，默认为不校验。 No SSHTunnelGateway Field Type Description Required bindPort int SSH 服务器监听端口。 YES privateKeyFile string SSH 服务器私钥文件路径。若为空，frps将读取autoGenPrivateKeyPath路径下的私钥文件。 No autoGenPrivateKeyPath string 私钥文件自动生成路径，默认为.</description>
    </item>
    <item>
      <title>客户端配置</title>
      <link>/zh-cn/docs/reference/client-configures/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/zh-cn/docs/reference/client-configures/</guid>
      <description>ClientConfig Field Type Description Required ClientCommonConfig 客户端通用配置。 Yes proxies []ProxyConfig 代理配置，不同的代理类型对应不同的配置，例如 TCPProxyConfig 或 HTTPProxyConfig。 No visitors []VisitorConfig 访问者配置，不同的访问者类型对应不同的配置，例如 STCPVisitorConfig。 No ClientCommonConfig Field Type Description Required auth AuthClientConfig 客户端鉴权配置。 No user string 用户名，设置此参数后，代理名称会被修改为 {user}.{proxyName}，避免代理名称和其他用户冲突。 No serverAddr string 连接服务端的地址。 No serverPort int 连接服务端的端口，默认为 7000。 No natHoleStunServer string xtcp 打洞所需的 stun 服务器地址，默认为 stun.easyvoip.com:3478。 No dnsServer string 使用 DNS 服务器地址，默认使用系统配置的 DNS 服务器，指定此参数可以强制替换为自定义的 DNS 服务器地址。 No loginFailExit bool 第一次登陆失败后是否退出，默认为 true。 No start []string 指定启用部分代理，当配置了较多代理，但是只希望启用其中部分时可以通过此参数指定，默认为全部启用。 No log LogConfig 日志配置。 No webServer WebServerConfig 客户端 AdminServer 配置。 No transport ClientTransportConfig 客户端网络层配置。 No virtualNet VirtualNetConfig 虚拟网络配置，Alpha 特性。 No featureGates map[string]bool 特性门控，用于启用或禁用实验性功能。 No udpPacketSize int 代理 UDP 服务时支持的最大包长度，默认为 1500，服务端和客户端需要保持配置一致。 No metadatas map[string]string 附加元数据，会传递给服务端插件，提供附加能力。 No includes []string 指定额外的配置文件目录，其中的 proxy 和 visitor 配置会被读取加载。 No store StoreConfig 持久化存储配置，用于保存代理和访问者配置。启用 webServer 后支持通过 Web UI 或 API 在运行时动态管理。 No StoreConfig Field Type Description Required path string 存储文件路径，配置后启用 Store 功能，支持运行时动态管理代理和访问者并持久化保存。 No ClientTransportConfig Field Type Description Required protocol string 和 frps 之间的通信协议，可选值为 tcp, kcp, quic, websocket, wss。默认为 tcp。 No dialServerTimeout int 连接服务端的超时时间，默认为 10s。 No dialServerKeepalive int 和服务端底层 TCP 连接的 keepalive 间隔时间，单位秒。 No connectServerLocalIP string 连接服务端时所绑定的本地 IP。 No proxyURL string 连接服务端使用的代理地址，格式为 {protocol}://user:passwd@192.</description>
    </item>
    <item>
      <title>代理配置</title>
      <link>/zh-cn/docs/reference/proxy/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/zh-cn/docs/reference/proxy/</guid>
      <description>ProxyBaseConfig Field Type Description Required name string 代理名称。 Yes type string 代理类型，可选值为 tcp, udp, http, https, tcpmux, stcp, sudp, xtcp。 Yes enabled *bool 是否启用该代理，默认为 true。设置为 false 可禁用该代理，用于单独控制每个代理的启用状态。 No annotations map[string]string 代理的注释信息，会被展示在 server 的 dashboard 中。 No transport ProxyTransport 代理网络层配置。 No metadatas map[string]string 附加元数据，会传递给服务端插件，提供附加能力。 No loadBalancer LoadBalancerConfig 负载均衡配置。 No healthCheck HealthCheckConfig 健康检查配置。 No ProxyBackend 代理后端服务配置。 Yes ProxyTransport Field Type Description Required useEncryption bool 是否启用加密功能，启用后该代理和服务端之间的通信内容都会被加密传输，如果 frpc 启用了全局 TLS，则不需要再启用此参数。 No useCompression bool 是否启用压缩功能，启用后该代理和服务端之间的通信内容都会被压缩传输。 No bandwidthLimit string 设置单个 proxy 的带宽限流，单位为 MB 或 KB，0 表示不限制，如果启用，默认会作用于对应的 frpc。 No bandwidthLimitMode string 限流类型，客户端限流或服务端限流，可选值为 client 和 server，默认为客户端限流。 No proxyProtocolVersion string 启用 proxy protocol 协议的版本，可选值为 v1 和 v2。如果启用，则 frpc 和本地服务建立连接后会发送 proxy protocol 的协议，包含了原请求的 IP 地址和端口等内容。 No ProxyBackend Field Type Description Required localIP string 被代理的本地服务 IP，默认为 127.</description>
    </item>
    <item>
      <title>访问者配置</title>
      <link>/zh-cn/docs/reference/visitor/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/zh-cn/docs/reference/visitor/</guid>
      <description>VisitorBaseConfig Field Type Description Required name string 访问者名称。 Yes type string 访问者类型，可选值为 stcp, sudp, xtcp。 Yes enabled *bool 是否启用该访问者，默认为 true。设置为 false 可禁用该访问者，用于单独控制每个访问者的启用状态。 No transport VisitorTransport 访问者网络层配置。 No secretKey string 密钥，服务端和访问端的密钥需要一致，访问端才能访问到服务端。 No serverUser string 要访问的 proxy 所属的用户名，如果为空，则默认为当前用户。 No serverName string 要访问的 proxy 名称。 Yes bindAddr string visitor 监听的本地地址，通过访问监听的地址和端口，连接到远端代理的服务。 No bindPort int visitor 监听的本地端口，如果为 -1，表示不需要监听物理端口，通常可以用于作为其他 visitor 的 fallback。 Yes plugin VisitorPluginOptions 访问者插件配置，用于扩展 visitor 功能。不同的插件类型对应不同的配置。 No VisitorTransport Field Type Description Required useEncryption bool 是否启用加密功能，启用后该代理和服务端之间的通信内容都会被加密传输，如果 frpc 启用了全局 TLS，则不需要再启用此参数。 No useCompression bool 是否启用压缩功能，启用后该代理和服务端之间的通信内容都会被压缩传输。 No STCPVisitorConfig Field Type Description Required VisitorBaseConfig 基础配置。 Yes SUDPVisitorConfig Field Type Description Required VisitorBaseConfig 基础配置。 Yes XTCPVisitorConfig Field Type Description Required VisitorBaseConfig 基础配置。 Yes protocol string 隧道底层通信协议，可选 quic 和 kcp，默认为 quic。 No keepTunnelOpen bool 是否保持隧道打开，如果开启，会定期检查隧道状态并尝试保持打开。 No maxRetriesAnHour int 每小时尝试打开隧道的次数，默认值为 8。 No minRetryInterval int 重试打开隧道的最小间隔时间，单位: 秒，默认为 90s。 No fallbackTo string 回退到的其他 visitor 名称。 No fallbackTimeoutMs int 连接建立超过多长时间(ms) 后回退到其他 visitor。 No natTraversal NatTraversalConfig NAT 穿透配置。 No </description>
    </item>
    <item>
      <title>客户端插件配置</title>
      <link>/zh-cn/docs/reference/client-plugin/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/zh-cn/docs/reference/client-plugin/</guid>
      <description>HTTPProxyPluginOptions Field Type Description Required type string 插件类型，设置为 &amp;ldquo;http_proxy&amp;rdquo;。 Yes httpUser string HTTP 代理用户名。 No httpPassword string HTTP 代理密码。 No Socks5PluginOptions Field Type Description Required type string 插件类型，设置为 &amp;ldquo;socks5&amp;rdquo;。 Yes username string 用户名。 No password string 密码。 No StaticFilePluginOptions Field Type Description Required type string 插件类型，设置为 &amp;ldquo;static_file&amp;rdquo;。 Yes localPath string 静态文件所在本地路径。 Yes stripPrefix string 去除用户 HTTP 请求 Path 的特定前缀。 No httpUser string HTTP Basic Auth 用户名。 No httpPassword string HTTP Basic Auth 密码。 No UnixDomainSocketPluginOptions Field Type Description Required type string 插件类型，设置为 &amp;ldquo;unix_domain_socket&amp;rdquo;。 Yes unixPath string UNIX 域套接字的地址。 Yes HTTP2HTTPSPluginOptions Field Type Description Required type string 插件类型，设置为 &amp;ldquo;http2https&amp;rdquo;。 Yes localAddr string 本地 HTTPS 服务地址。 Yes hostHeaderRewrite string 替换 Host header。 No requestHeaders HeaderOperations 对请求 Header 的操作配置。 No HTTPS2HTTPPluginOptions Field Type Description Required type string 插件类型，设置为 &amp;ldquo;https2http&amp;rdquo;。 Yes localAddr string 本地 HTTPS 服务地址。 Yes hostHeaderRewrite string 替换 Host header。 No requestHeaders HeaderOperations 对请求 Header 的操作配置。 No enableHTTP2 bool 是否启用 HTTP/2，默认启用。 No crtPath string TLS 证书文件路径。 No keyPath string TLS 密钥文件路径。 No HTTPS2HTTPSPluginOptions Field Type Description Required type string 插件类型，设置为 &amp;ldquo;https2https&amp;rdquo;。 Yes localAddr string 本地 HTTPS 服务地址。 Yes hostHeaderRewrite string 替换 Host header。 No requestHeaders HeaderOperations 对请求 Header 的操作配置。 No enableHTTP2 bool 是否启用 HTTP/2，默认启用。 No crtPath string TLS 证书文件路径。 No keyPath string TLS 密钥文件路径。 No TLS2RawPluginOptions Field Type Description Required type string 插件类型，设置为 &amp;ldquo;tls2raw&amp;rdquo;。 Yes localAddr string 本地服务地址。 Yes crtPath string TLS 证书文件路径。 No keyPath string TLS 密钥文件路径。 No VirtualNetPluginOptions Field Type Description Required type string 插件类型，设置为 &amp;ldquo;virtual_net&amp;rdquo;。 Yes </description>
    </item>
    <item>
      <title>访问者插件配置</title>
      <link>/zh-cn/docs/reference/visitor-plugin/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/zh-cn/docs/reference/visitor-plugin/</guid>
      <description>VirtualNetVisitorPluginOptions Field Type Description Required type string 插件类型，设置为 &amp;ldquo;virtual_net&amp;rdquo;。 Yes destinationIP string 要访问的目标虚拟 IP 地址。通常是服务端的虚拟网络地址。 Yes </description>
    </item>
  </channel>
</rss>
