---
title: 订阅服务器
description: >-
  一个独立的 HTTP/HTTPS 服务器，用于向客户端提供代理订阅链接（标准、JSON 和 Clash）。该服务器监听自己的端口（默认
  2096），并在“设置 → 订阅”中进行配置。新面板会为每种格式生成随机路径前缀，所有路径仍可自定义。所有订阅端点都会设置响应头，供客户端应用读取流量/到期信息。
full: true
_openapi:
  preload:
    - ./public/openapi.json
  toc:
    - depth: 2
      title: >-
        返回与该订阅 ID 匹配的所有已启用客户端的 base64 编码订阅链接。当请求带有 Accept: text/html
        头或 ?html=1 时，改为渲染一个带样式的信息页面。路径前缀由 subPath 配置。
      url: >-
        #return-base64-encoded-subscription-links-for-all-enabled-clients-matching-the-subscription-id-when-the-request-has-an-accept-texthtml-header-or-html1-renders-a-styled-info-page-instead-with-formatinfo-returns-the-page-view-model-as-json-traffic-expiry-online-status-no-links-for-live-polling-the-path-prefix-is-configured-by-subpath
    - depth: 2
      title: >-
        以代理配置的 JSON 数组形式返回订阅（每个已启用客户端一项）。仅在设置中启用 JSON 订阅时可用。路径前缀由 subJsonPath 配置。
      url: >-
        #return-subscription-as-a-json-array-of-proxy-configs-one-per-enabled-client-only-when-json-subscription-is-enabled-in-settings-the-path-prefix-is-configured-by-subjsonpath
    - depth: 2
      title: >-
        以兼容 Clash/Mihomo 的 YAML 配置形式返回订阅，其中包含已配置的全局 Clash 路由规则。仅在设置中启用 Clash
        订阅时可用。路径前缀由 subClashPath 配置。
      url: >-
        #return-subscription-as-a-clashmihomo-compatible-yaml-config-including-configured-global-clash-routing-rules-only-when-clash-subscription-is-enabled-in-settings-the-path-prefix-is-configured-by-subclashpath
  structuredData:
    headings:
      - content: >-
          返回与该订阅 ID 匹配的所有已启用客户端的 base64 编码订阅链接。当请求带有 Accept:
          text/html 头或 ?html=1 时，改为渲染一个带样式的信息页面。路径前缀由 subPath 配置。
        id: >-
          return-base64-encoded-subscription-links-for-all-enabled-clients-matching-the-subscription-id-when-the-request-has-an-accept-texthtml-header-or-html1-renders-a-styled-info-page-instead-with-formatinfo-returns-the-page-view-model-as-json-traffic-expiry-online-status-no-links-for-live-polling-the-path-prefix-is-configured-by-subpath
      - content: >-
          以代理配置的 JSON 数组形式返回订阅（每个已启用客户端一项）。仅在设置中启用 JSON 订阅时可用。路径前缀由 subJsonPath 配置。
        id: >-
          return-subscription-as-a-json-array-of-proxy-configs-one-per-enabled-client-only-when-json-subscription-is-enabled-in-settings-the-path-prefix-is-configured-by-subjsonpath
      - content: >-
          以兼容 Clash/Mihomo 的 YAML 配置形式返回订阅，其中包含已配置的全局 Clash 路由规则。仅在设置中启用 Clash
          订阅时可用。路径前缀由 subClashPath 配置。
        id: >-
          return-subscription-as-a-clashmihomo-compatible-yaml-config-including-configured-global-clash-routing-rules-only-when-clash-subscription-is-enabled-in-settings-the-path-prefix-is-configured-by-subclashpath
    contents: []
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

export default function Layout(props) {
  const { APIPage, OpenAPIPage } = props.components ?? {};
  // "APIPage" is the old name from v10, this allows both for backward compatibility
  const Comp = OpenAPIPage ?? APIPage;
  return (
    <>
      {props.children}
      <Comp document="./public/openapi.json" webhooks={[]} operations={[{"path":"/{subPath}{subid}","method":"get"},{"path":"/{jsonPath}{subid}","method":"get"},{"path":"/{clashPath}{subid}","method":"get"}]} showTitle />
    </>
  );
}
