Skip to content

[Feature]: Streamline macOS setup with Proxy URL Paste & App Picker (auto-covering helper processes) #305

Open

Description

@wuyexiong

Platform

macOS

ProxyBridge Version

4.1.3

OS and Version

macOS 27.2 (Apple Silicon arm64)

Documentation

Code Review

  • I have gone through the code page

Describe the Feature

Problem

ProxyBridge works great at the system extension level on macOS, but configuring a proxy for a specific desktop app currently involves quite a bit of manual friction:

  1. Manual field-by-field proxy entry: Users usually already have a proxy string in their clipboard (e.g., http://127.0.0.1:7897, socks5://user:pass@host:1080, or 127.0.0.1:7890), but have to manually split and type Type, Host, Port, Username, and Password into separate fields.
  2. Finding Bundle IDs and hidden helper binaries is hard: Modern macOS apps (especially Electron apps, IDEs, and AI tools) spawn multiple helper apps and embedded binaries (e.g., Helper (Renderer), language_server, etc.) that may not share the main app's bundle identifier. Users currently have to run terminal commands (osascript / ps) or watch the Connections log one by one to figure out what strings to type into Process / Bundle Identifier.

Proposed Solution

Keep the existing rule/proxy architecture intact, and add two lightweight UX helpers to the existing SwiftUI sheets (plus an optional quick action in Connections):

  1. "Paste Proxy URL" in Add / Edit Proxy sheet:
    • Allow pasting a standard proxy URL (socks5://[user:pass@]host:port, http://[user:pass@]host:port, or host:port) via a "Paste from Clipboard" button (or smart paste field) that auto-populates Type, Host, Port, Username, and Password.
  2. "Choose App..." Picker in Add / Edit Rule sheet:
    • Add a Choose App... button next to the Process / Bundle Identifier field.
    • Let the user pick an .app bundle from /Applications (with app icons via standard NSOpenPanel or an installed apps list).
    • Automatically append both the main bundle ID and the app bundle path wildcard (e.g., com.example.App; /Applications/Example.app/*) so all embedded helpers and bundled child binaries inside .app/Contents/ are covered out of the box without manual log hunting.
  3. (Optional) Quick rule creation from Connections tab:
    • Allow right-clicking / selecting a logged connection entry (especially standalone CLI tools like curl or agy) to open Add Rule with that process name pre-filled.

Benefits

  • Turns a multi-step terminal + log-hunting setup into a 2-click workflow for everyday macOS users.
  • Eliminates the most common pitfall where selecting only a main Bundle ID misses Electron helpers or bundled language servers/daemons.
  • 100% backward-compatible with existing profiles, CLI format, and extension rule matching logic.

Additional Context

Concrete Implementation Suggestions (based on current MacOS/ codebase)

Since the extension side (AppProxyProvider.swift -> ProxyRule.FlowProcess, updated in #288) already supports matching both bundle IDs and full-path wildcards like /Applications/Foo.app/*, this requires zero changes to the Network Extension and can be implemented purely in the GUI layer:

  1. Proxy URL Parser in ProxySettingsView.swift (ProxyConfigEditorView):

    • Add a Paste URL button in the form header/section that reads NSPasteboard.general.string(forType: .string).
    • Parse using URLComponents (handling schemes socks5, socks5h, http, https, plus a fallback for bare host:port strings):
      • Map scheme -> type (SOCKS5 / HTTP)
      • Map host, port, user, password directly into the existing @State fields of ProxyConfigEditorView.
  2. App Bundle Picker in ProxyRulesView.swift (RuleEditorView):

    • Add a Choose App... button next to the Process / Bundle Identifier field.
    • Open an NSOpenPanel configured with:
      • allowedContentTypes = [.applicationBundle]
      • directoryURL = URL(fileURLWithPath: "/Applications")
      • allowsMultipleSelection = true
    • For each selected appURL:
      • Read Bundle(url: appURL)?.bundleIdentifier (if present).
      • Generate "<bundleId>; \(appURL.path)/*" (e.g., com.example.app; /Applications/Example.app/*) and append it (deduplicated, ; -separated) to processNames, replacing the default * if untouched.
    • If Rule Name is still empty, optionally pre-fill ruleName with the app's display name (appURL.deletingPathExtension().lastPathComponent).
  3. Quick Action in ContentView.swift (ConnectionsView):

    • Since ConnectionsView currently renders into an NSTextView (LogTextView) from viewModel.connections, a lightweight option without rewriting the text view would be a small menu/picker or contextual action to open RuleEditorView pre-populated with a selected process from viewModel.connections.

Happy to provide more details or help test if needed. Thanks again for building and maintaining ProxyBridge!

Activity

  1. added
    enhancement
    on Nov 21, 2026
  2. Anof-cyber commented on Nov 22, 2026

    @Anof-cyber
    Member

    2nd one, app picker, that feature is there in Windows and Linux, same in macos is what i also want but its not possible.

    Macos app is sandbox, macos won't allow app to select and see other apps :). Its a macos restriction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MacOSenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions