Commit Graph

561 Commits

Author SHA1 Message Date
wanghongenpin
772abb3a5a 1.2.8-beta v1.2.8-beta 2026-05-28 12:49:03 +08:00
wanghongenpin
215a4af98a feat(selection): implement mobile multi-select functionality (#730) (#566) 2026-05-26 16:24:21 +08:00
wanghongenpin
cc6c454eff feat(selection): update clear method and improve selection action bar visibility 2026-05-19 19:48:09 +08:00
wanghongenpin
bb88aac6b8 feat(selection): implement multi-select functionality with action bar (#730) (#566) 2026-05-19 03:29:26 +08:00
wanghongenpin
6ae7b0962c feat(http_proxy): enhance error handling and add request rewrite on connect failure (#740) 2026-05-15 22:32:40 +08:00
wanghongenpin
5abacaf057 Merge pull request #764 from testercengdong/fix/macos-process-info-fork-leak
fix(macos): use libproc FFI for process info to eliminate fork leak
2026-05-12 13:25:36 +08:00
testercengdong
71e49421ae fix(macos,process_info): filter LISTEN sockets + .app suffix + alloc safety
Three issues raised by ultrareview on top of the previous review pass:

1. (regression) findPidByLocalTcpPort accepted any TCP socket whose
   insi_lport matched, including LISTEN sockets. The original
   `lsof | grep "${port}->"` excluded LISTEN entries implicitly via the
   "->" filter (LISTEN renders as `*:port (LISTEN)`, no `->`). When a
   long-running daemon LISTENs on a port that coincides with a client's
   ephemeral source port, proc_listpids hits the lower-PID daemon first
   and misattributes the request; with the new 30s pid cache the wrong
   PID stuck for 30s of follow-up requests. Now skip sockets with
   insi_fport == 0 (the LISTEN signature) to mirror the old grep filter
   exactly.

2. (pre-existing) getProcess in the macOS path unconditionally appended
   ".app" to the executable path, producing non-existent paths like
   "/usr/bin/curl.app" for non-bundle binaries. This poisoned the icon
   cache with empty bytes for 5 minutes. Now only append when the path
   actually contains ".app/"; standalone binaries use the executable
   path verbatim.

3. (nit) pidBuf/sockBuf were allocated before the outer try, leaking on
   the (extremely rare) case that the second calloc throws. Moved both
   allocations inside the try with null-aware free in finally, matching
   the pattern the inner fdBuf loop already uses.

Verified:
- LISTEN-only port -> FFI returns null (matches lsof+grep behavior)
- ESTABLISHED outbound -> FFI returns the correct client PID
- 500 concurrent curl through proxy -> single ProxyPin process, no
  fork leaks (original #763 fix preserved)
2026-05-12 11:28:33 +08:00
testercengdong
d69b95dbbc fix(macos,process_info): tighten error handling and add endian assert
- Guard against `getProcess` returning null in the macOS FFI path
  (`proc_pidpath` can fail with EPERM or for an already-exited PID).
  Stop unwrapping with `!` and only populate the ProcessInfoCache on
  success; the previous code threw NullThrownError there, which the
  outer try/catch silently swallowed and prevented caching of valid
  later results.
- Add a 5-second negative cache for ports whose owner can't be
  resolved (typical for short-lived clients that exited before we
  scanned). Without it every such request triggered a full PID list
  rescan, defeating the point of the pid cache for the failure path.
- Add a debug-only assert that the host is little-endian. The libproc
  parsing reads `(int)htons(port)` by treating the low two bytes as a
  big-endian uint16, which requires a little-endian host. All shipping
  macOS hardware satisfies this; the assert fails loudly if the
  assumption is ever broken (stripped from release builds).

Re-verified on macOS 26.4: 500 concurrent curl through the proxy,
single ProxyPin process throughout, 9099 freed immediately on exit.
2026-05-12 10:16:42 +08:00
testercengdong
ad89ec6aec fix(macos,process_info): address Copilot review feedback
- Add 30s (host:port) -> pid cache in ProcessInfoUtils so the synchronous
  libproc scan stays off the request hot path for keep-alive flows
  (typical HTTP client reuses the same source port across requests in
  a connection).
- Lift sockView ByteData out of the inner fd loop so the buffer wrapper
  is reused across all fds in a scan (saves per-fd allocations).
- Bail out of the scan after 16 consecutive proc_pidfdinfo size
  mismatches, in case a future macOS bumps the socket_fdinfo layout --
  avoids wasted syscalls instead of scanning every fd just to return
  null at the end.

Re-verified end-to-end on macOS 26.4: 500 concurrent curl, 0 fork
leaks, 9099 freed immediately on app exit, no errors in logs.
2026-05-12 09:38:02 +08:00
wanghongenpin
fa990cd520 fix: improve app icon loading and caching in InstalledAppsWidget (#739) 2026-05-12 05:24:32 +08:00
testercengdong
202050b35f fix(macos): use libproc FFI for process info to eliminate fork leak
Replace Process.run('lsof') and Process.run('ps') in the request hot
path with direct libproc syscalls (proc_listpids, proc_pidinfo,
proc_pidfdinfo, proc_pidpath) via dart:ffi.

Each Process.run on macOS goes through fork()+execvp(). In a
multi-threaded Dart VM the forked child can deadlock before exec on
mutexes that were held by other threads at fork time (POSIX fork()
only clones the calling thread, leaving cloned mutex state with no
owners in the child). Under proxy load (~500 concurrent requests),
roughly 2% of the fork()s deadlock; the orphaned children inherit the
listening proxy fd and pin it for the lifetime of the system, so the
port stays bound even after the parent app exits.

libproc syscalls do not spawn child processes, so they avoid the fork
problem entirely. They are also about an order of magnitude faster
than spawning lsof per request.

Windows and Linux paths are unchanged (independent follow-up).

Verified end-to-end on macOS 26.4 / Darwin 25.4:
- 500 concurrent curl through the proxy: 0 fork leaks (was ~2% before)
- Process icons still resolve correctly for .app bundles (Chrome,
  Safari, Lark, etc.)
- 9099 frees immediately on app exit (no orphan listeners)

Fixes #763
2026-05-11 15:23:59 +08:00
wanghongenpin
980b8b3037 feat: add 'Copy as fetch' and other clipboard options to request menu (#685) 2026-05-10 21:20:24 +08:00
wanghongenpin
a950c71d81 feat: add 'Copy as fetch' functionality (#685) 2026-05-10 21:03:41 +08:00
wanghongenpin
1447cd529a feat: implement system proxy cleanup on session end 2026-05-09 14:02:04 +08:00
wanghongenpin
cd86e1dbcb fix: ensure configuration is flushed on enable change 2026-05-08 03:41:00 +08:00
wanghongenpin
e0b29cf08f feat: add minimize to tray functionality (#711) 2026-05-07 23:57:49 +08:00
wanghongenpin
0c6acb2567 feat: add minimize to tray functionality (#711) 2026-05-07 20:31:21 +08:00
wanghongenpin
eb2abd8f29 Merge pull request #753 from Pandaver/main
feat: add split report mode for report server
2026-04-27 03:29:10 +08:00
Pandaver
b887aa4854 fix: handle error phase and sync response param in split report mode
分离模式下 onError 时跳过 response 阶段上报,
同时显式同步 response 参数到 request.response 避免参数被忽略。
2026-04-22 21:24:06 +08:00
Pandaver
9d420d086a Merge branch 'wanghongenpin:main' into main 2026-04-22 20:46:08 +08:00
wanghongenpin
8f9a79f5e3 Merge pull request #745 from Pandaver/fix-non-ascii-report-server-name
fix: URL encode report server name to support non-ASCII characters (#744)
2026-04-22 15:17:37 +08:00
Pandaver
ddad789d6f feat: add split report mode for report server
支持分离上报模式,开启后 request 和 response 分两次独立上报,
通过 _id 关联。解决 response 超时或无响应时请求无法上报的问题。
2026-04-21 12:53:44 +08:00
wanghongenpin
5b440ef43a mac profile v1.2.7 2026-04-14 15:14:51 +08:00
Pandaver
554124d494 fix: URL encode report server name to support non-ASCII characters (#744) 2026-04-13 11:53:06 +08:00
wanghongenpin
3eb4986496 1.2.7-beta 2026-04-12 18:47:18 +08:00
wanghongenpin
841d0fd449 optimize rendering of large texts 2026-04-09 21:32:22 +08:00
wanghongenpin
22fc0d3ba5 feat: add CSS and JS formatting support and improve body text handling 2026-04-09 05:28:34 +08:00
wanghongenpin
055910b4be feat: refactor futureWidget into _FutureWidget for improved state management 2026-04-09 04:15:48 +08:00
wanghongenpin
80df6cbc88 feat: enhance HighlightTextWidget with language support and refactor highlighting logic (#721) 2026-04-08 22:50:19 +08:00
wanghongenpin
bcd8af3e2d feat: add XML and HTML formatting support (#721) 2026-04-04 00:59:46 +08:00
wanghongenpin
87fb5a7f21 Add guidance to remote script loading (#735) 2026-04-02 15:19:13 +08:00
wanghongenpin
5a3ab74ddb add AGENTS.md 2026-03-30 21:23:17 +08:00
wanghongenpin
654d27667a feat: implement batch processing for remote history sharing 2026-03-30 03:12:41 +08:00
wanghongenpin
1aff89ed8c feat: implement quick share functionality for remote devices 2026-03-29 02:14:19 +08:00
wanghongenpin
7c9c4066dd refactor: improve request management and auto-read handling (#718) 2026-03-25 02:44:05 +08:00
wanghongenpin
69cc1aff8d refactor: enhance auto-read request management 2026-03-25 01:29:50 +08:00
wanghongenpin
c706174894 add export functionality for domain HAR files (#725) 2026-03-22 01:43:24 +08:00
wanghongenpin
8ab517bb38 Favorites support WebSocket message persistence (#709) 2026-03-20 19:21:11 +08:00
wanghongenpin
5293171f37 custom repeat supports specifying the selected time (#712) 2026-03-18 01:20:19 +08:00
wanghongenpin
d7a3a2593b Merge pull request #659 from yuuouu/main
optimize camera permission process
2026-03-15 13:34:01 +08:00
wanghongenpin
3fe5ec3f74 update mobile drawer menu 2026-03-12 23:34:33 +08:00
wanghongenpin
25fec1f5e0 fix h2 IPv6 parse v1.2.6 2026-03-11 21:04:49 +08:00
wanghongenpin
42842236ea Update request breakpoint matching to use regular expressions for improved URL matching 2026-03-10 22:06:28 +08:00
wanghongenpin
0095344b50 Validate proxy port input and show error for out-of-range values 2026-03-07 11:51:56 +08:00
wanghongenpin
8013615b4d Refactor request breakpoint management to eliminate instance retrieval and pass manager directly 2026-03-01 23:55:10 +08:00
wanghongenpin
f8345c32c2 1.2.6-beta 2026-03-01 20:46:35 +08:00
wanghongenpin
531732696d Enhance request and response handling to support null values and improve breakpoint execution logic 2026-02-28 21:29:48 +08:00
wanghongenpin
3c4b97380d Refactor request breakpoint handling to use ExpiringCache for paused requests and responses 2026-02-28 21:22:25 +08:00
wanghongenpin
6bf5063bed Add autocomplete suggestions for HTTP headers in request editor 2026-02-27 01:00:03 +08:00
wanghongenpin
905d8932bd Add breakpoint export and import (#669)(#660)(#386) 2026-02-25 16:41:12 +08:00