mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-06 08:03:47 +00:00
feat(proxy): support IPv4 and IPv6 direct routes (#193)
This commit is contained in:
1 parent
7927714032
commit
a256090eab
13 files changed
+59
-17
No files matched your search
@@ -159,6 +159,8 @@ Generated keys contain 192 random bits. Custom keys accept 16–256 letters, dig
|
||||
|
||||
Configuration supports bulk import of inline proxies, individual checks, and staged removal. Manage `proxyfile` entries in their source file; relative paths are resolved against the configuration directory. Removal remains a draft until the complete configuration is saved.
|
||||
|
||||
Direct routes are `direct` (dual stack), `direct4` (IPv4 only), and `direct6` (IPv6 only). Add one per line in the proxy form or `proxyfile`; checks use that route's address family. List a route before using it as a `proxy_bindings` target. Bound keys retain fail-closed routing if the selected family is unavailable; dual stack uses Go's normal address selection, not round-robin across families. Saves and reloads apply route changes to new requests without restarting. The existing WARP selection rules are unchanged. Go quota reads and OAuth device authorization/token refresh use separate control-plane clients and are not pinned by these routes.
|
||||
|
||||
`POST /api/proxies/check` requires a session and CSRF. Submit exactly one of these requests:
|
||||
|
||||
```json
|
||||
|
||||
@@ -159,6 +159,8 @@ Key、代理、上游、超时、模型、偏好、reasoning 和日志设置热
|
||||
|
||||
配置中心支持批量导入内联代理、逐项检查及暂存移除。代理文件 `proxyfile` 的内容应在来源文件管理;相对路径以配置目录为准。移除仅为草稿,保存完整配置后才生效。
|
||||
|
||||
直连路由支持 `direct`(双栈)、`direct4`(仅 IPv4)、`direct6`(仅 IPv6),可在代理表单或 `proxyfile` 中每行填写一个,连通性检查也遵守所选地址族。作为 `proxy_bindings` 目标前须先声明该路由;已绑定 Key 在所选地址族不可用时保持 fail-closed,不会改走另一地址族。双栈使用 Go 的正常地址选择,不是轮流分配 IPv4/IPv6。保存或重载后新请求立即使用新路由,无需重启。既有 WARP 选择规则不变。Go 额度读取及 OAuth 设备授权、Token 刷新使用独立控制面客户端,不受这些路由绑定。
|
||||
|
||||
`POST /api/proxies/check` 要求 Session、CSRF,以下两种请求只能选一种:
|
||||
|
||||
```json
|
||||
|
||||
Reference in new issue
Block a user