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
ProxyPin
English | 中文
Open source free traffic capture HTTP(S),Support Windows、Mac、Android、IOS、Linux Full platform system
You can use it to intercept, inspect & rewrite HTTP(S) traffic, Support capturing Flutter app traffic, ProxyPin is based on Flutter develop, and the UI is beautiful and easy to use.
Features
- Mobile scan code connection: no need to manually configure WiFi proxy, including configuration synchronization. All terminals can scan codes to connect and forward traffic to each other.
- Domain name filtering: Only intercept the traffic you need, and do not intercept other traffic to avoid interference with other applications.
- Search: Search requests according to keywords, response types and other conditions
- Script: Support writing JavaScript scripts to process requests or responses.
- Request Rewrite: Support redirection, support replacement of request or response message, and can also modify request or response according to the increase.
- Request Mapping: Do not request remote services, use local configuration or scripts for response
- Request Decryption: Configure AES decryption key to automatically decrypt HTTP message body
- Request Blocking: Support blocking requests according to URL, and do not send requests to the server.
- History: Automatically save the captured traffic data for easy backtracking and viewing. Support HAR format export and import.
- Others: Favorites, toolbox, common encoding tools, as well as QR codes, regular expressions, etc.
Mac will prompt untrusted developers when first opened, you need to go to System Preferences-Security & Privacy-Allow any source.
Sponsors
If ProxyPin is helpful to you, you are welcome to support us in the following ways to help the project develop in the long term:
- Buy Me A Coffee
- AFDIAN
- Submit feedback and suggestions to help us improve
- Contribute code or documentation to the project
Your support will be used for project maintenance, feature development, and user experience optimization. Thank you very much!
Downloads
Github Releases: https://github.com/wanghongenpin/proxypin/releases
iOS App Store:https://apps.apple.com/app/proxypin/id6450932949
Android Google Play:https://play.google.com/store/apps/details?id=com.network.proxy
We will continue to improve the features and experience, as well as optimize the UI.