跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

applied.go

21 行 · 679 B历史下载
1package managedproxy
2
3import "errors"
4
5// Applied is the single source of truth for the private endpoint used by Cage.
6func Applied(profile, endpoint, revision string) (Store, error) {
7 p, err := Load(profile)
8 if err != nil {
9 return p, err
10 }
11 if _, ok := p.Find(p.Selected); !ok {
12 return p, errors.New("尚未选择代理节点,请在网络与代理中添加来源并选择节点")
13 }
14 if revision == "" || p.Revision == "" || revision != p.Revision || endpoint != p.Endpoint() {
15 return p, errors.New("代理节点尚未应用或配置不一致,请重新应用节点;外网保持关闭")
16 }
17 if _, err := p.Route(); err != nil {
18 return p, err
19 }
20 return p, nil
21}