Replies: 2 comments
|
这个我们第 12 章记录过类似现象(host 权限白名单按 origin 匹配):127.0.0.1 和 localhost 在浏览器里是不同的 origin,Harness 的 trustedHosts 若只放行 localhost,127.0.0.1 访问就会 403。 临时解决:浏览器访问时用终端输出的确切地址(或改 trustedHosts 同时放行两个)。 |
0 replies
|
wsl同样的问题,按照你的说法,改成localhost则可以访问。 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
环境:
操作系统:macOS 26.6.1/M4 Pro
Node.js:v24.19.0
pnpm:11.7.0
DeepSeek Harness:0.1.0-rc.5
安装方式:从源码运行
问题描述
执行:
pnpm dsh web
Harness 启动后输出:
dsh web: http://127.0.0.1:3080
按照终端输出的地址访问 Web UI 后,部分需要 Host/权限能力的 API 会持续返回 403 Forbidden。
例如:
POST http://127.0.0.1:3080/api/host.describe
403 Forbidden
POST http://127.0.0.1:3080/api/settings.describe
403 Forbidden
POST http://127.0.0.1:3080/api/agentPreset.list
403 Forbidden
因此 Web UI 中会出现:
Agent 预设显示“正在加载预设”或无法正常加载
权限显示“不可用”
DevTools Console 中持续出现 HTTP 403
复现步骤
临时解决方法
将访问地址改为:
http://localhost:3080
使用 localhost 后,上述 Host API 可以正常工作,设置页面中的 Agent 预设和权限也可以正常加载。
也就是说,在同一个本地 Harness 进程下:
http://127.0.0.1:3080
→ Host API 403
http://localhost:3080
→ 正常
期望行为
127.0.0.1 和 localhost 都属于本机回环地址。
如果当前 Host API 的权限或来源校验要求使用 localhost,那么建议 dsh web 在启动后默认向用户显示:
http://localhost:3080
至少在 macOS 环境下如此。
另一种更完整的修复方式是让 127.0.0.1 和 localhost 在本地 Host API 权限检查中具有一致的行为
补充说明
目前我只能确认这个问题在我的 macOS 环境下可以稳定复现,因此还无法确认 Windows/Linux 是否存在相同问题。
本 Issue 更主要是报告:
macOS 下,程序默认输出的 127.0.0.1:3080 地址与实际可正常工作的 localhost:3080 存在行为差异。
如果维护者确认这是 macOS 特有的问题,那么可以考虑仅针对 macOS 调整默认显示地址
All reactions