入站详情可以测常用 AI 服务的可访问性
release / release (push) Successful in 29s

判定按状态码白名单而不是只认 200:探测不带鉴权,OpenAI 回 401、Anthropic 回 405
才是正常应答,说明 TLS 握手、路由、目标服务全都正常。清单和白名单照 sub2api 的
代理质量检查抄来。

失败文案不照抄 Bun:本机端口没人监听时它给的是「Unable to connect. Is the
computer able to access the url?」,把矛头指向目标网址,而真正的原因在本机。

对话框留在 InboundDetail 而不是提到 RouterPage——它不写配置文件也不改内核状态,
不需要走那条 commit 链路。firstPort 挪进 shared/inbounds.ts,两个页面都要用它了。
This commit is contained in:
2026-08-31 03:59:08 +08:00
parent 7d2a3afff0
commit 3d7304dd22
12 changed files with 716 additions and 34 deletions
+8
View File
@@ -8,6 +8,7 @@ import type { ConfigDiagnostic, ConfigObject } from '../vendor/config-editor/ind
import type { ConnectionSnapshot } from '@shared/connections.ts'
import type { ExitProbe, HostInfo } from '@shared/host-info.ts'
import type { GeoFileStatus } from '@shared/geo.ts'
import type { ReachResult } from '@shared/reachability.ts'
import { DEFAULT_TEST_URL, testUrl } from './prefs'
const TOKEN_KEY = 'patchbay.token'
@@ -194,6 +195,13 @@ export const api = {
*/
probeExit: (port: number) => request<ExitProbe>('GET', `/api/host/exit?port=${String(port)}`),
/**
* 经由某个入站端口探测一个目标能不能访问。一次一个目标,调用方并发发起。
* 同样会发起真实的外网请求,只在用户点了测试时调。
*/
probeReach: (port: number, target: string) =>
request<ReachResult>('GET', `/api/host/reach?port=${String(port)}&target=${target}`),
/** 内核的运行时设置:运行模式、各代理端口、allow-lan 等。 */
kernelConfigs: () => request<Record<string, unknown>>('GET', '/api/kernel/configs'),