fix: working HTTP and SOCKS5 proxies; save only working servers

- SOCKS5 had been fed to HttpClient.findProxy, which supports only HTTP
  proxies ("Invalid proxy configuration"), and socks5h was treated as an
  HTTP proxy ("Invalid request method"). HTTP/HTTPS proxies stay on
  findProxy; socks5/socks5h tunnel through socks5_proxy, which resolves
  names at the proxy; user:pass in the proxy URL is passed along.
- Saving moved to the successful path: a failed attempt stays in the form
  with a short reason, and the server list keeps no duplicates.
- package net.blumia.openchamber.flutter (namespace, applicationId,
  MainActivity, iOS bundle id), version 0.3.1 (code 301).
- show the proxy in the instance and server lists; clearer connect errors.
- tool/proxy_probe.dart checks direct, socks5, socks5h and HTTP proxies
  (requests and SSE) against a live server.
This commit is contained in:
blumia committed 2026-11-18 22:18:45 +08:00
1 parent 782ac2bd4d
commit 55dac37baf
12 files changed
+227 -46

No files matched your search

+13
View File
@@ -27,6 +27,19 @@
---
## 0.3.1 修复(分支 `flutter`)
| 项 | 结果 |
| --- | --- |
| 代理 | 支持 `http://`、`https://`(`HttpClient.findProxy`)与 `socks5://`、`socks5h://`(`socks5_proxy` 包为 `HttpClient` 建 SOCKS 隧道,统一在代理解析域名),可带 `user:pass@`。此前 `socks5` 直接塞进 `findProxy` 导致 “Invalid proxy configuration”,`socks5h` 被当成 HTTP 代理导致 “Invalid request method” |
| 验证 | `tool/proxy_probe.dart` 对本机服务器 + 本地 SOCKS5(1080)/HTTP(8081) 测试代理跑通 direct / socks5 / socks5h / http 与 SSE;模拟器上分别用 `socks5://127.0.0.1:1080` 和 `http://127.0.0.1:8081` 连上并列出会话 |
| 失败不落库 | 连接成功才保存(`_connected` upsert);失败的尝试留在表单并显示简短原因(如「连接被拒绝:服务器或代理未启动,或端口不对」),返回列表后不残留错误 |
| 包名 | `net.blumia.openchamber.flutter`(namespace、applicationId、MainActivity、iOS bundle id 同步) |
| 版本 | **0.3.1(code 301)** |
| 小改进 | 实例/服务器列表显示「经由 <代理>」,区分同地址不同代理;连接错误中文化 |
---
## 0.2 迁移到 MyGo(2026-11-18,分支 `mygo`,0.3.0)
**背景**:Asuka 0.2 把应用语言从 Go 换成了自研 Asuka 语言(C 内核、无 Go 运行时),继续留在 Go 线已没有上游维护;