mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
feat(proxy): 重构 Proxy 节点管理与隧道系统
- 重构 proxy_nodes 管理端,支持节点注册、心跳、隧道生命周期管理 - 增强 tunnel 嵌入式 hub 和隧道协议 - 重构 aether-proxy 配置、隧道客户端、心跳和调度机制 - 调整 admin OAuth/配额/导入等处理器的参数传递 - 扩展数据迁移模块 - 补充 proxy nodes、OAuth、配额、系统导入等测试 - 更新前端 proxy nodes 视图和 API
This commit is contained in:
@@ -793,7 +793,7 @@ mod tests {
|
||||
use axum::{Json, Router};
|
||||
use serde_json::json;
|
||||
|
||||
use super::DirectSyncExecutionRuntime;
|
||||
use super::{build_client, DirectSyncExecutionRuntime, ExecutionTransportControls};
|
||||
use crate::frontdoor_loop_guard::{
|
||||
frontdoor_self_loop_public_ai_path, gateway_frontdoor_self_loop_guard_error_with_port,
|
||||
gateway_frontdoor_self_loop_guard_matches_with_port,
|
||||
@@ -842,6 +842,32 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn direct_sync_execution_runtime_builds_clients_for_socks_proxy_urls() {
|
||||
let timeouts = ExecutionTimeouts {
|
||||
connect_ms: Some(5_000),
|
||||
total_ms: Some(5_000),
|
||||
..ExecutionTimeouts::default()
|
||||
};
|
||||
|
||||
for proxy_url in ["socks5://127.0.0.1:1080", "socks5h://127.0.0.1:1080"] {
|
||||
build_client(
|
||||
Some(&timeouts),
|
||||
Some(&aether_contracts::ProxySnapshot {
|
||||
enabled: Some(true),
|
||||
mode: Some("socks".into()),
|
||||
node_id: None,
|
||||
label: Some("manual-proxy".into()),
|
||||
url: Some(proxy_url.to_string()),
|
||||
extra: None,
|
||||
}),
|
||||
None,
|
||||
ExecutionTransportControls::default(),
|
||||
)
|
||||
.unwrap_or_else(|err| panic!("client should build for {proxy_url}: {err}"));
|
||||
}
|
||||
}
|
||||
|
||||
fn tunnel_proxy_snapshot(base_url: String) -> aether_contracts::ProxySnapshot {
|
||||
aether_contracts::ProxySnapshot {
|
||||
enabled: Some(true),
|
||||
|
||||
Reference in New Issue
Block a user