(proxyGroupName: string, proxyName: string)
| 137 | } |
| 138 | |
| 139 | export const handlerProxySelect = async (proxyGroupName: string, proxyName: string) => { |
| 140 | const client = getSingboxClient()?.client |
| 141 | if (!client) return |
| 142 | |
| 143 | await client.selectOutbound({ groupTag: proxyGroupName, outboundTag: proxyName }) |
| 144 | |
| 145 | // 乐观更新,流随后会确认 |
| 146 | const group = groups.get(proxyGroupName) |
| 147 | if (group) { |
| 148 | group.selected = proxyName |
| 149 | rebuild() |
| 150 | } |
| 151 | |
| 152 | if (automaticDisconnection.value) { |
| 153 | activeConnections.value |
| 154 | .filter((c) => getConnectionChains(c).includes(proxyGroupName)) |
| 155 | .forEach((c) => disconnectByIdAPI(c.id)) |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | // sing-box native API 的 URLTest 是组级别;节点卡片触发测速时转为所在组测速。 |
| 160 | export const proxyLatencyTest = async ( |
nothing calls this directly
no test coverage detected