feat(proxy-tunnel): add proxy endpoint profile test

This commit is contained in:
azens authored and GitHub committed 2026-07-21 22:56:39 +08:00
1 parent d4c28c5a9a
commit 7edab93ec2
15 files changed
+1085 -92

No files matched your search

+32
View File
@@ -8,12 +8,44 @@ const patterns: [RegExp, string][] = [
[/^Agent requires Java 21, but DBX started it with an older Java runtime\. Use DBX managed JRE 21 or select a Java 21 executable in Driver Manager\./, "connection.agentJavaTooOld"],
[/^JDBC plugin is not installed\. Install the optional JDBC plugin to use this connection\.$/, "connection.jdbcPluginNotInstalled"],
[/^ai\.configNameExists:(.+)$/, "ai.configNameExists"],
// Tunnel / proxy test messages
[/^HTTP CONNECT proxy connection successful \((\d+)\)$/, "settings.tunnelsHttpTestSuccess"],
[/^SOCKS5 proxy connection successful$/, "settings.tunnelsSocks5TestSuccess"],
[/^SSH tunnel connection successful$/, "settings.tunnelsTestSuccess"],
[/^Proxy host is required\.$/, "settings.tunnelsProxyHostRequired"],
[/^Proxy port is required\.$/, "settings.tunnelsProxyPortRequired"],
[/^SSH host is required\.$/, "settings.tunnelsSshHostRequired"],
[/^Tunnel test is not supported for HTTP tunnel profiles\.$/, "settings.tunnelsHttpTunnelUnsupported"],
[/^Proxy connection timed out \(([^)]+)\)$/, "settings.tunnelsProxyTimedOut"],
[/^Failed to connect to proxy: (.+)$/, "settings.tunnelsProxyConnectFailed"],
[/^Proxy handshake failed \([^)]+\): (.+)$/, "settings.tunnelsProxyHandshakeFailed"],
[/^Proxy handshake timed out \(([^)]+)\)$/, "settings.tunnelsProxyHandshakeTimedOut"],
[/^HTTP proxy CONNECT failed: (.+)$/, "settings.tunnelsHttpConnectFailed"],
[/^Invalid SOCKS proxy version: (\d+)$/, "settings.tunnelsSocksInvalidVersion"],
[/^SOCKS username or password is too long$/, "settings.tunnelsSocksAuthTooLong"],
[/^SOCKS proxy authentication failed$/, "settings.tunnelsSocksAuthFailed"],
[/^SOCKS proxy rejected all supported auth methods$/, "settings.tunnelsSocksAuthRejected"],
[/^SOCKS proxy selected unsupported auth method: (\d+)$/, "settings.tunnelsSocksUnsupportedAuth"],
[/^Proxy host too long for SOCKS5 domain address$/, "settings.tunnelsSocksHostTooLong"],
[/^SOCKS proxy connect rejected \(code (\d+)\)$/, "settings.tunnelsSocksConnectRejected"],
[/^Unsupported SOCKS bound address type: (\d+)$/, "settings.tunnelsSocksUnsupportedAddrType"],
];
const paramNames: Record<string, string> = {
"connection.driverNotInstalled": "driver",
"connection.jreNotInstalled": "jre",
"ai.configNameExists": "name",
"settings.tunnelsHttpTestSuccess": "code",
"settings.tunnelsProxyTimedOut": "duration",
"settings.tunnelsProxyConnectFailed": "error",
"settings.tunnelsProxyHandshakeFailed": "error",
"settings.tunnelsProxyHandshakeTimedOut": "duration",
"settings.tunnelsHttpConnectFailed": "detail",
"settings.tunnelsSocksInvalidVersion": "version",
"settings.tunnelsSocksUnsupportedAuth": "method",
"settings.tunnelsSocksConnectRejected": "code",
"settings.tunnelsSocksUnsupportedAddrType": "type",
};
export function translateBackendError(t: ComposerTranslation, message: string): string {
+22 -1
View File
@@ -510,6 +510,8 @@ export default {
proxyUsernamePlaceholder: "Optional",
proxyPassword: "Proxy Password",
proxyPasswordPlaceholder: "Optional",
proxyTestTarget: "Test Target",
proxyTestTargetPlaceholder: "host:port — empty = endpoint check, fill for full tunnel test",
tunnelProfile: "Tunnel Profile",
tunnelProfileCustom: "Custom (this connection only)",
tunnelProfileManaged: "Managed by a shared tunnel profile. Edit it in Settings > Tunnels — changes apply to every connection using it on its next connection.",
@@ -3504,8 +3506,27 @@ export default {
tunnelsUnsavedHint: "Unsaved changes",
tunnelsTest: "Test",
tunnelsTesting: "Testing...",
tunnelsTestSuccess: "SSH tunnel connection successful",
tunnelsTestSuccess: "Tunnel test successful",
tunnelsTestFailed: "Tunnel test failed: {message}",
tunnelsHttpTestSuccess: "HTTP CONNECT proxy connection successful ({code})",
tunnelsSocks5TestSuccess: "SOCKS5 proxy connection successful",
tunnelsProxyHostRequired: "Proxy host is required.",
tunnelsProxyPortRequired: "Proxy port is required.",
tunnelsSshHostRequired: "SSH host is required.",
tunnelsHttpTunnelUnsupported: "Tunnel test is not supported for HTTP tunnel profiles.",
tunnelsProxyTimedOut: "Proxy connection timed out ({duration})",
tunnelsProxyConnectFailed: "Failed to connect to proxy: {error}",
tunnelsProxyHandshakeFailed: "Proxy handshake failed: {error}",
tunnelsProxyHandshakeTimedOut: "Proxy handshake timed out ({duration})",
tunnelsHttpConnectFailed: "HTTP proxy CONNECT failed: {detail}",
tunnelsSocksInvalidVersion: "Invalid SOCKS proxy version: {version}",
tunnelsSocksAuthTooLong: "SOCKS username or password is too long",
tunnelsSocksAuthFailed: "SOCKS proxy authentication failed",
tunnelsSocksAuthRejected: "SOCKS proxy rejected all supported auth methods",
tunnelsSocksUnsupportedAuth: "SOCKS proxy selected unsupported auth method: {method}",
tunnelsSocksHostTooLong: "Proxy host too long for SOCKS5 domain address",
tunnelsSocksConnectRejected: "SOCKS proxy connect rejected (code {code})",
tunnelsSocksUnsupportedAddrType: "Unsupported SOCKS bound address type: {type}",
redisTab: "Redis",
shortcutsTab: "Shortcuts",
snippetsTab: "Snippets",
+22 -1
View File
@@ -411,6 +411,8 @@ export default withEnglishFallback({
proxyUsernamePlaceholder: "Opcional",
proxyPassword: "Contraseña del proxy",
proxyPasswordPlaceholder: "Opcional",
proxyTestTarget: "Destino de prueba",
proxyTestTargetPlaceholder: "host:port — vacío = verif. endpoint, completar para prueba completa",
tunnelProfile: "Perfil de túnel",
tunnelProfileCustom: "Personalizado (solo esta conexión)",
tunnelProfileManaged: "Gestionado por un perfil de túnel compartido. Edítalo en Ajustes > Túneles; los cambios se aplican a todas las conexiones que lo usan en su próxima conexión.",
@@ -3282,8 +3284,27 @@ export default withEnglishFallback({
tunnelsUnsavedHint: "Cambios sin guardar",
tunnelsTest: "Probar",
tunnelsTesting: "Probando...",
tunnelsTestSuccess: "Conexión del túnel SSH correcta",
tunnelsTestSuccess: "Prueba de túnel correcta",
tunnelsTestFailed: "Error al probar el túnel: {message}",
tunnelsHttpTestSuccess: "Conexión proxy HTTP CONNECT correcta ({code})",
tunnelsSocks5TestSuccess: "Conexión proxy SOCKS5 correcta",
tunnelsProxyHostRequired: "El host del proxy es obligatorio.",
tunnelsProxyPortRequired: "El puerto del proxy es obligatorio.",
tunnelsSshHostRequired: "El host SSH es obligatorio.",
tunnelsHttpTunnelUnsupported: "La prueba de túnel no está soportada para perfiles de túnel HTTP.",
tunnelsProxyTimedOut: "La conexión al proxy agotó el tiempo de espera ({duration})",
tunnelsProxyConnectFailed: "Error al conectar con el proxy: {error}",
tunnelsProxyHandshakeFailed: "Error en el handshake con el proxy: {error}",
tunnelsProxyHandshakeTimedOut: "El handshake con el proxy agotó el tiempo de espera ({duration})",
tunnelsHttpConnectFailed: "Error en CONNECT del proxy HTTP: {detail}",
tunnelsSocksInvalidVersion: "Versión de proxy SOCKS no válida: {version}",
tunnelsSocksAuthTooLong: "El usuario o la contraseña de SOCKS es demasiado largo",
tunnelsSocksAuthFailed: "Falló la autenticación del proxy SOCKS",
tunnelsSocksAuthRejected: "El proxy SOCKS rechazó todos los métodos de autenticación",
tunnelsSocksUnsupportedAuth: "El proxy SOCKS seleccionó un método de autenticación no soportado: {method}",
tunnelsSocksHostTooLong: "El host del proxy es demasiado largo para la dirección SOCKS5",
tunnelsSocksConnectRejected: "Conexión proxy SOCKS rechazada (código {code})",
tunnelsSocksUnsupportedAddrType: "Tipo de dirección de enlace SOCKS no soportado: {type}",
redisTab: "Redis",
shortcutsTab: "Atajos",
snippetsTab: "Fragmentos",
+22 -1
View File
@@ -409,6 +409,8 @@ export default withEnglishFallback({
proxyUsernamePlaceholder: "Opzionale",
proxyPassword: "Password Proxy",
proxyPasswordPlaceholder: "Opzionale",
proxyTestTarget: "Destinazione test",
proxyTestTargetPlaceholder: "host:port — vuoto = verif. endpoint, compilare per test completo",
tunnelProfile: "Profilo tunnel",
tunnelProfileCustom: "Personalizzato (solo questa connessione)",
tunnelProfileManaged: "Gestito da un profilo tunnel condiviso. Modificalo in Impostazioni > Tunnel; le modifiche si applicano a tutte le connessioni che lo usano alla prossima connessione.",
@@ -3280,8 +3282,27 @@ export default withEnglishFallback({
tunnelsUnsavedHint: "Modifiche non salvate",
tunnelsTest: "Prova",
tunnelsTesting: "Prova in corso...",
tunnelsTestSuccess: "Connessione tunnel SSH riuscita",
tunnelsTestSuccess: "Test del tunnel riuscito",
tunnelsTestFailed: "Prova del tunnel non riuscita: {message}",
tunnelsHttpTestSuccess: "Connessione proxy HTTP CONNECT riuscita ({code})",
tunnelsSocks5TestSuccess: "Connessione proxy SOCKS5 riuscita",
tunnelsProxyHostRequired: "L'host del proxy è obbligatorio.",
tunnelsProxyPortRequired: "La porta del proxy è obbligatoria.",
tunnelsSshHostRequired: "L'host SSH è obbligatorio.",
tunnelsHttpTunnelUnsupported: "Il test del tunnel non è supportato per i profili tunnel HTTP.",
tunnelsProxyTimedOut: "Connessione al proxy scaduta ({duration})",
tunnelsProxyConnectFailed: "Impossibile connettersi al proxy: {error}",
tunnelsProxyHandshakeFailed: "Handshake con il proxy fallito: {error}",
tunnelsProxyHandshakeTimedOut: "Handshake con il proxy scaduto ({duration})",
tunnelsHttpConnectFailed: "CONNECT proxy HTTP fallito: {detail}",
tunnelsSocksInvalidVersion: "Versione proxy SOCKS non valida: {version}",
tunnelsSocksAuthTooLong: "Nome utente o password SOCKS troppo lungo",
tunnelsSocksAuthFailed: "Autenticazione proxy SOCKS fallita",
tunnelsSocksAuthRejected: "Il proxy SOCKS ha rifiutato tutti i metodi di autenticazione",
tunnelsSocksUnsupportedAuth: "Il proxy SOCKS ha selezionato un metodo di autenticazione non supportato: {method}",
tunnelsSocksHostTooLong: "L'host del proxy è troppo lungo per l'indirizzo SOCKS5",
tunnelsSocksConnectRejected: "Connessione proxy SOCKS rifiutata (codice {code})",
tunnelsSocksUnsupportedAddrType: "Tipo di indirizzo di bind SOCKS non supportato: {type}",
redisTab: "Redis",
shortcutsTab: "Scorciatoie",
snippetsTab: "Snippet",
+22 -1
View File
@@ -403,6 +403,8 @@ export default withEnglishFallback({
proxyUsernamePlaceholder: "任意",
proxyPassword: "プロキシパスワード",
proxyPasswordPlaceholder: "任意",
proxyTestTarget: "テストターゲット",
proxyTestTargetPlaceholder: "host:port — 空欄はエンドポイントチェックのみ、完全テストには入力してください",
tunnelProfile: "トンネルプロファイル",
tunnelProfileCustom: "カスタム(この接続のみ)",
tunnelProfileManaged: "共有トンネルプロファイルで管理されています。設定 > トンネル で編集すると、次回接続時にこのプロファイルを使用するすべての接続に反映されます。",
@@ -3281,8 +3283,27 @@ export default withEnglishFallback({
tunnelsUnsavedHint: "未保存の変更があります",
tunnelsTest: "テスト",
tunnelsTesting: "テスト中...",
tunnelsTestSuccess: "SSH トンネル接続に成功しました",
tunnelsTestSuccess: "トンネルテスト成功",
tunnelsTestFailed: "トンネルのテストに失敗しました: {message}",
tunnelsHttpTestSuccess: "HTTP CONNECT プロキシ接続に成功しました ({code})",
tunnelsSocks5TestSuccess: "SOCKS5 プロキシ接続に成功しました",
tunnelsProxyHostRequired: "プロキシホストが必要です",
tunnelsProxyPortRequired: "プロキシポートが必要です",
tunnelsSshHostRequired: "SSH ホストが必要です",
tunnelsHttpTunnelUnsupported: "HTTP トンネルプロファイルのテストはサポートされていません",
tunnelsProxyTimedOut: "プロキシ接続がタイムアウトしました ({duration})",
tunnelsProxyConnectFailed: "プロキシに接続できません: {error}",
tunnelsProxyHandshakeFailed: "プロキシハンドシェイクに失敗しました: {error}",
tunnelsProxyHandshakeTimedOut: "プロキシハンドシェイクがタイムアウトしました ({duration})",
tunnelsHttpConnectFailed: "HTTP プロキシ CONNECT に失敗しました: {detail}",
tunnelsSocksInvalidVersion: "SOCKS プロキシバージョンが無効です: {version}",
tunnelsSocksAuthTooLong: "SOCKS ユーザー名またはパスワードが長すぎます",
tunnelsSocksAuthFailed: "SOCKS プロキシ認証に失敗しました",
tunnelsSocksAuthRejected: "SOCKS プロキシがすべての認証方法を拒否しました",
tunnelsSocksUnsupportedAuth: "SOCKS プロキシがサポートされていない認証方法を選択しました: {method}",
tunnelsSocksHostTooLong: "SOCKS5 ドメインアドレス用プロキシホストが長すぎます",
tunnelsSocksConnectRejected: "SOCKS プロキシ接続が拒否されました (code {code})",
tunnelsSocksUnsupportedAddrType: "サポートされていない SOCKS バインドアドレスタイプ: {type}",
redisTab: "Redis",
shortcutsTab: "ショートカット",
snippetsTab: "スニペット",
+22 -1
View File
@@ -410,6 +410,8 @@ export default withEnglishFallback({
proxyUsernamePlaceholder: "Opcional",
proxyPassword: "Senha do Proxy",
proxyPasswordPlaceholder: "Opcional",
proxyTestTarget: "Alvo de teste",
proxyTestTargetPlaceholder: "host:port — vazio = verif. endpoint, preencher para teste completo",
tunnelProfile: "Perfil de túnel",
tunnelProfileCustom: "Personalizado (somente esta conexão)",
tunnelProfileManaged: "Gerenciado por um perfil de túnel compartilhado. Edite-o em Configurações > Túneis; as alterações se aplicam a todas as conexões que o usam na próxima conexão.",
@@ -3282,8 +3284,27 @@ export default withEnglishFallback({
tunnelsUnsavedHint: "Alterações não salvas",
tunnelsTest: "Testar",
tunnelsTesting: "Testando...",
tunnelsTestSuccess: "Conexão do túnel SSH bem-sucedida",
tunnelsTestSuccess: "Teste de túnel bem-sucedido",
tunnelsTestFailed: "Falha no teste do túnel: {message}",
tunnelsHttpTestSuccess: "Conexão com proxy HTTP CONNECT bem-sucedida ({code})",
tunnelsSocks5TestSuccess: "Conexão com proxy SOCKS5 bem-sucedida",
tunnelsProxyHostRequired: "O host do proxy é obrigatório.",
tunnelsProxyPortRequired: "A porta do proxy é obrigatória.",
tunnelsSshHostRequired: "O host SSH é obrigatório.",
tunnelsHttpTunnelUnsupported: "O teste de túnel não é compatível com perfis de túnel HTTP.",
tunnelsProxyTimedOut: "Conexão com o proxy expirou ({duration})",
tunnelsProxyConnectFailed: "Falha ao conectar ao proxy: {error}",
tunnelsProxyHandshakeFailed: "Handshake com o proxy falhou: {error}",
tunnelsProxyHandshakeTimedOut: "Handshake com o proxy expirou ({duration})",
tunnelsHttpConnectFailed: "CONNECT do proxy HTTP falhou: {detail}",
tunnelsSocksInvalidVersion: "Versão de proxy SOCKS inválida: {version}",
tunnelsSocksAuthTooLong: "Usuário ou senha SOCKS muito longo",
tunnelsSocksAuthFailed: "Autenticação do proxy SOCKS falhou",
tunnelsSocksAuthRejected: "O proxy SOCKS rejeitou todos os métodos de autenticação",
tunnelsSocksUnsupportedAuth: "O proxy SOCKS selecionou um método de autenticação não compatível: {method}",
tunnelsSocksHostTooLong: "Host do proxy muito longo para endereço SOCKS5",
tunnelsSocksConnectRejected: "Conexão com proxy SOCKS rejeitada (código {code})",
tunnelsSocksUnsupportedAddrType: "Tipo de endereço de bind SOCKS não compatível: {type}",
redisTab: "Redis",
shortcutsTab: "Atalhos",
snippetsTab: "Snippets",
+22 -1
View File
@@ -514,6 +514,8 @@ export default withEnglishFallback({
proxyUsernamePlaceholder: "可选",
proxyPassword: "代理密码",
proxyPasswordPlaceholder: "可选",
proxyTestTarget: "测试目标",
proxyTestTargetPlaceholder: "host:port — 留空仅做端点检测,填写真实地址进行完整验证",
tunnelProfile: "隧道档案",
tunnelProfileCustom: "自定义(仅此连接)",
tunnelProfileManaged: "由共享隧道档案管理。请在 设置 > 隧道维护 中编辑,修改会在下次连接时对所有使用该档案的连接生效。",
@@ -3494,8 +3496,27 @@ export default withEnglishFallback({
tunnelsUnsavedHint: "有未保存的修改",
tunnelsTest: "测试",
tunnelsTesting: "测试中...",
tunnelsTestSuccess: "SSH 隧道连接成功",
tunnelsTestSuccess: "隧道测试成功",
tunnelsTestFailed: "隧道测试失败:{message}",
tunnelsHttpTestSuccess: "HTTP CONNECT 代理连接成功 ({code})",
tunnelsSocks5TestSuccess: "SOCKS5 代理连接成功",
tunnelsProxyHostRequired: "请输入代理主机",
tunnelsProxyPortRequired: "请输入代理端口",
tunnelsSshHostRequired: "请输入 SSH 主机",
tunnelsHttpTunnelUnsupported: "HTTP 隧道不支持单独测试",
tunnelsProxyTimedOut: "代理连接超时 ({duration})",
tunnelsProxyConnectFailed: "无法连接到代理: {error}",
tunnelsProxyHandshakeFailed: "代理握手失败: {error}",
tunnelsProxyHandshakeTimedOut: "代理握手超时 ({duration})",
tunnelsHttpConnectFailed: "HTTP CONNECT 代理连接失败: {detail}",
tunnelsSocksInvalidVersion: "SOCKS5 代理版本无效: {version}",
tunnelsSocksAuthTooLong: "SOCKS5 用户名或密码过长",
tunnelsSocksAuthFailed: "SOCKS5 代理认证失败",
tunnelsSocksAuthRejected: "SOCKS5 代理拒绝了所有认证方式",
tunnelsSocksUnsupportedAuth: "SOCKS5 代理选择了不支持的认证方式: {method}",
tunnelsSocksHostTooLong: "代理主机地址过长",
tunnelsSocksConnectRejected: "SOCKS5 连接被拒 (code {code})",
tunnelsSocksUnsupportedAddrType: "不支持的 SOCKS5 绑定地址类型: {type}",
redisTab: "Redis",
shortcutsTab: "快捷键",
snippetsTab: "代码片段",
+22 -1
View File
@@ -410,6 +410,8 @@ export default withEnglishFallback({
proxyUsernamePlaceholder: "可選",
proxyPassword: "代理伺服器密碼",
proxyPasswordPlaceholder: "可選",
proxyTestTarget: "測試目標",
proxyTestTargetPlaceholder: "host:port — 留空僅做端點檢測,填寫真實位址進行完整驗證",
tunnelProfile: "隧道設定檔",
tunnelProfileCustom: "自訂(僅此連線)",
tunnelProfileManaged: "由共用隧道設定檔管理。請在 設定 > 隧道維護 中編輯,變更會在下次連線時套用到所有使用該設定檔的連線。",
@@ -3107,8 +3109,27 @@ export default withEnglishFallback({
tunnelsUnsavedHint: "有未儲存的變更",
tunnelsTest: "測試",
tunnelsTesting: "測試中...",
tunnelsTestSuccess: "SSH 通道連線成功",
tunnelsTestSuccess: "通道測試成功",
tunnelsTestFailed: "通道測試失敗:{message}",
tunnelsHttpTestSuccess: "HTTP CONNECT 代理連線成功({code})",
tunnelsSocks5TestSuccess: "SOCKS5 代理連線成功",
tunnelsProxyHostRequired: "請輸入代理主機",
tunnelsProxyPortRequired: "請輸入代理連接埠",
tunnelsSshHostRequired: "請輸入 SSH 主機",
tunnelsHttpTunnelUnsupported: "HTTP 隧道設定檔不支援測試",
tunnelsProxyTimedOut: "代理連線逾時({duration})",
tunnelsProxyConnectFailed: "無法連線到代理伺服器:{error}",
tunnelsProxyHandshakeFailed: "代理握手失敗:{error}",
tunnelsProxyHandshakeTimedOut: "代理握手逾時({duration})",
tunnelsHttpConnectFailed: "HTTP 代理 CONNECT 失敗:{detail}",
tunnelsSocksInvalidVersion: "SOCKS 代理版本無效:{version}",
tunnelsSocksAuthTooLong: "SOCKS 使用者名稱或密碼過長",
tunnelsSocksAuthFailed: "SOCKS 代理認證失敗",
tunnelsSocksAuthRejected: "SOCKS 代理拒絕了所有認證方式",
tunnelsSocksUnsupportedAuth: "SOCKS 代理選擇了不支援的認證方式:{method}",
tunnelsSocksHostTooLong: "代理主機位址過長",
tunnelsSocksConnectRejected: "SOCKS 代理連線被拒(代碼 {code})",
tunnelsSocksUnsupportedAddrType: "不支援的 SOCKS 綁定位址類型:{type}",
fontFamily: "字型",
uiFontFamily: "介面字型",
uiFontAppDefault: "DBX 預設",