clash-verge-controller

Clash Verge 外部控制(RESTful API)技能。基于 mihomo 内核,提供完整的 API 调用指南、配置说明和代码示例。 当用户提到以下场景时触发: - Clash Verge 外部控制、RESTful API、远程管理 - 通过 API 切换节点、查看连接、管理规则 - clash-verge、clash.meta、mihomo 控制器配置 - 获取代理信息、测试延迟、重启内核等操作

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "clash-verge-controller" with this command: npx skills add gyaoshi/clash-verge-controller

Clash Verge 外部控制

##必要信息 开始前需要获取用户的clash verge外部监听地址和密钥,并确认clash verge外部监听已打开。

核心原理

Clash Verge 内置 mihomo (Clash.Meta) 内核,通过 RESTful API 实现外部控制,支持切换节点、管理规则、监控连接等操作。

配置文件设置

在 Clash 配置文件中添加:

# 外部控制 (API) 配置
external-controller: 127.0.0.1:9090

# API 访问密钥(强烈建议设置)
secret: "your-secret-key-here"

# CORS 跨域配置
external-controller-cors:
  allow-origins:
    - '*'
  allow-private-network: true

配置说明:

配置项说明
external-controllerAPI 监听地址,127.0.0.1 仅本地,0.0.0.0 允许外部访问
secretAPI 密钥,开启后请求需携带 Authorization: Bearer ${secret}

常用 API 接口

基础调用格式:

# 无密钥
curl http://127.0.0.1:9090/{endpoint}

# 有密钥
curl -H "Authorization: Bearer ${secret}" http://127.0.0.1:9090/{endpoint}

代理操作

操作方法端点说明
获取代理列表GET/proxies查看所有代理和策略组
切换节点PUT/proxies/{name}{"name": "香港节点"}
测试延迟GET/proxies/{name}/delay?url=https://www.google.com&timeout=5000返回延迟(ms)

策略组操作

操作方法端点说明
获取策略组GET/group列出所有策略组
获取指定组GET/group/{name}查看特定策略组详情
清除自动选择DELETE/group/{name}清除 auto 组 fixed 选择

配置操作

操作方法端点说明
获取配置GET/configs查看当前配置
更新配置PATCH/configs{"mixed-port": 7890}
重启内核POST/restart重载配置
更新 GEOPOST/configs/geo{"path": "", "payload": ""}

监控操作

操作方法端点说明
实时日志WS/logs?level=infoWebSocket 获取日志
流量信息WS/traffic实时流量(kbps)
连接列表GET/connections查看所有连接
关闭连接DELETE/connections关闭所有连接
DNS 查询GET/dns/query?name=example.com&type=A查询 DNS 记录

完整 API 参考

详细 API 文档(包含所有端点、参数、返回值)见: references/api_reference.md

代码示例

Python

import requests

API = "http://127.0.0.1:9090"
SECRET = "your-secret-key"
headers = {"Authorization": f"Bearer {SECRET}"}

# 获取代理列表
proxies = requests.get(f"{API}/proxies", headers=headers).json()

# 切换节点
requests.put(
    f"{API}/proxies/Proxy",
    headers=headers,
    json={"name": "香港节点-01"}
)

# 测试延迟
result = requests.get(
    f"{API}/proxies/香港节点/delay",
    params={"url": "https://www.google.com", "timeout": 5000}
).json()
print(f"延迟: {result.get('delay')}ms")

Node.js

const axios = require('axios');

const API = 'http://127.0.0.1:9090';
const SECRET = 'your-secret-key';
const headers = { Authorization: `Bearer ${SECRET}` };

// 获取代理列表
const { data } = await axios.get(`${API}/proxies`, { headers });

// 切换节点
await axios.put(
  `${API}/proxies/Proxy`,
  { name: '香港节点-01' },
  { headers }
);

安全建议

  1. 使用密钥:生产环境务必设置 secret
  2. 限制监听:仅本地用 127.0.0.1,需要远程访问再改 0.0.0.0
  3. 配合防火墙:开启外部访问时限制 IP
  4. 使用 HTTPS:敏感网络配置 TLS

官方文档

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Polymarket Politics Random Buyer

Randomly finds a live Polymarket politics market, checks trading context, and buys 1 USDC by default with explicit dry-run and live modes for AION Market.

Registry SourceRecently Updated
General

DB Schenker

德国铁路集团旗下物流巨头,专注欧洲最大陆运网络及多式联运,提供空运、海运及合同物流服务。

Registry SourceRecently Updated
General

Secretary Memory

OpenClaw 秘书式多分区记忆系统 v3.0。仿生现代秘书的笔记本分类法,支持:(1) 多分区并发搜索 + 每分区3条上下文召回,(2) 会话自动摘要,(3) 偏好自动提取 + 用户关系图谱,(4) 记忆冲突主动检测,(5) 定时 consolidation + 会话结束 hook,(6) 精细化恢复/回溯,...

Registry SourceRecently Updated
General

Hunt

Digital bounty hunter skill for finding, tracking, and managing online hackathon opportunities. Trigger when the user says "hunt", "find hackathons", "show m...

Registry SourceRecently Updated