github.com/igoogolx/clash@v1.19.8/docs/runtime/external-controller.md (about)

     1  ---
     2  sidebarTitle: The External Controller
     3  sidebarOrder: 1
     4  ---
     5  
     6  # The External Controller
     7  
     8  ## Introduction
     9  
    10  External Controller enables users to control Clash programmatically with the HTTP RESTful API. The third-party Clash GUIs are heavily based on this feature. Enable this feature by specifying an address in `external-controller`.
    11  
    12  ## Authentication
    13  
    14  - External Controllers Accept `Bearer Tokens` as access authentication method.
    15    - Use `Authorization: Bearer <Your Secret>` as your request header in order to pass credentials.
    16  
    17  ## RESTful API Documentation
    18  
    19  ### Logs
    20  
    21  - `/logs`
    22    - Method: `GET`
    23      - Full Path: `GET /logs`
    24      - Description: Get real-time logs
    25  
    26  ### Traffic
    27  
    28  - `/traffic`
    29    - Method: `GET`
    30      - Full Path: `GET /traffic`
    31      - Description: Get real-time traffic data
    32  
    33  ### Version
    34  
    35  - `/version`
    36    - Method: `GET`
    37      - Full Path: `GET /version`
    38      - Description: Get clash version
    39  
    40  ### Configs
    41  
    42  - `/configs`
    43    - Method: `GET`
    44      - Full Path: `GET /configs`
    45      - Description: Get base configs
    46  
    47    - Method: `PUT`
    48      - Full Path: `PUT /configs`
    49      - Description: Reloading base configs
    50  
    51    - Method: `PATCH`
    52      - Full Path: `PATCH /configs`
    53      - Description: Update base configs
    54  
    55  ### Proxies
    56  
    57  - `/proxies`
    58    - Method: `GET`
    59      - Full Path: `GET /proxies`
    60      - Description: Get proxies information
    61  
    62  - `/proxies/:name`
    63    - Method: `GET`
    64      - Full Path: `GET /proxies/:name`
    65      - Description: Get specific proxy information
    66  
    67    - Method: `PUT`
    68      - Full Path: `PUT /proxies/:name`
    69      - Description: Select specific proxy
    70  
    71  - `/proxies/:name/delay`
    72    - Method: `GET`
    73      - Full Path: `GET /proxies/:name/delay`
    74      - Description: Get specific proxy delay test information
    75  
    76  ### Rules
    77  
    78  - `/rules`
    79    - Method: `GET`
    80      - Full Path: `GET /rules`
    81      - Description: Get rules information
    82  
    83  ### Connections
    84  
    85  - `/connections`
    86    - Method: `GET`
    87      - Full Path: `GET /connections`
    88      - Description: Get connections information
    89  
    90    - Method: `DELETE`
    91      - Full Path: `DELETE /connections`
    92      - Description: Close all connections
    93  
    94  - `/connections/:id`
    95    - Method: `DELETE`
    96      - Full Path: `DELETE /connections/:id`
    97      - Description: Close specific connection
    98  
    99  ### Providers
   100  
   101  - `/providers/proxies`
   102    - Method: `GET`
   103      - Full Path: `GET /providers/proxies`
   104      - Description: Get all proxies information for all proxy-providers
   105  
   106  - `/providers/proxies/:name`
   107    - Method: `GET`
   108      - Full Path: `GET /providers/proxies/:name`
   109      - Description: Get proxies information for specific proxy-provider
   110  
   111    - Method: `PUT`
   112      - Full Path: `PUT /providers/proxies/:name`
   113      - Description: Select specific proxy-provider
   114  
   115  - `/providers/proxies/:name/healthcheck`
   116    - Method: `GET`
   117      - Full Path: `GET /providers/proxies/:name/healthcheck`
   118      - Description: Get proxies information for specific proxy-provider
   119  
   120  ### DNS Query
   121  
   122  - `/dns/query`
   123    - Method: `GET`
   124    - Full Path: `GET /dns/query?name={name}[&type={type}]`
   125    - Description: Get DNS query data for a specified name and type.
   126    - Parameters:
   127      - `name` (required): The domain name to query.
   128      - `type` (optional): The DNS record type to query (e.g., A, MX, CNAME, etc.). Defaults to `A` if not provided.
   129  
   130    - Example: `GET /dns/query?name=example.com&type=A`