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

+11 -5
View File
@@ -5,8 +5,8 @@ Android first. This branch (`flutter`) is a framework evaluation: the same
feature set as the earlier Asuka/Go and MyGo attempts, reimplemented in
Flutter to compare mobile UI maturity.
Status: 0.3.0 — servers (passwordless / password login, HTTP/SOCKS5 proxy,
self-signed certificates and pinning), session list with search and live
Status: 0.3.1 — servers (passwordless / password login, HTTP/HTTPS and
SOCKS5/socks5h proxy, self-signed certificates and pinning), session list with search and live
events, chat with streaming Markdown, tool rows with image previews, a
context usage ring with a detail sheet, model/agent switching, copy / fork /
revert, attachments (photos/files), permissions. Android 7.0 (API 24)+.
@@ -15,7 +15,7 @@ revert, attachments (photos/files), permissions. Android 7.0 (API 24)+.
| Path | What |
| --- | --- |
| `lib/api/` | Dart OpenChamber client: auth, sessions, messages, SSE, models/agents, permissions, prompt/interrupt/fork/revert, `/api/fs/raw`; HTTP proxy via `HttpClient.findProxy`, SOCKS5 via dart:io's SOCKS, pinning/self-signed via `badCertificateCallback` |
| `lib/api/` | Dart OpenChamber client: auth, sessions, messages, SSE, models/agents, permissions, prompt/interrupt/fork/revert, `/api/fs/raw`; HTTP/HTTPS proxies via `HttpClient.findProxy`, SOCKS5/socks5h via `socks5_proxy`, pinning/self-signed via `badCertificateCallback` |
| `lib/storage.dart` | Saved servers in `shared_preferences`, tokens in `flutter_secure_storage` (Android Keystore) |
| `lib/state.dart` | The app state: connections, live sessions, the open chat, and SSE event folding |
| `lib/screens/` | Servers, sessions, chat (streaming Markdown via `gpt_markdown`, composer, sheets) |
@@ -46,9 +46,15 @@ flutter test
flutter build apk --release # dist artifacts in build/app/outputs/flutter-apk
```
`android/app/build.gradle.kts` sets `minSdk 24` and signs releases with
`android/app/build.gradle.kts` sets the application id
`net.blumia.openchamber.flutter`, `minSdk 24`, and signs releases with
`~/SDK/test-upload.jks` (override via `OPENCHAMBER_KEYSTORE*` env). Dart's
`HttpClient` dials sockets itself, so plain `http://` LAN servers work in
release without a cleartext manifest flag, as with the Go clients.
release without a cleartext manifest flag, as with the Go clients. Only a
working connection is saved: a failed attempt stays in the form.
Proxies accept `http://`, `https://`, `socks5://` and `socks5h://` (the
last two resolve names at the proxy). `tool/proxy_probe.dart` checks the
client against a live server through local test proxies.
Earlier attempts: `main` (Asuka/Go, 0.2.x) and `mygo` (MyGo, 0.3.0).