-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
Currently, when Dev Proxy runs as a system proxy, all HTTP/HTTPS traffic flows through it. Dev Proxy filters requests internally based on urlsToWatch, but unrelated traffic still takes the detour through the proxy. This can cause issues with services that are sensitive to proxying (e.g., Azure Functions startup, Teams auth) and adds unnecessary latency to non-watched traffic.
Proposal: Have Dev Proxy serve a PAC (Proxy Auto-Config) file that routes only watched hosts through the proxy. All other traffic goes direct.
How it would work:
- Dev Proxy generates a
FindProxyForURL()script from the configuredurlsToWatchhosts - Serves it at an endpoint like
http://127.0.0.1:{port}/proxy.pacwith MIME typeapplication/x-ns-proxy-autoconfig - Instead of setting the system HTTP/HTTPS proxy, sets the system's auto-config URL to point to this PAC file
- macOS:
networksetup -setautoproxyurl <service> http://127.0.0.1:{port}/proxy.pac - Windows: set
AutoConfigURLregistry key or use the proxy library equivalent
- macOS:
Example generated PAC file for urlsToWatch: ["https://graph.microsoft.com/*", "https://api.contoso.com/*"]:
function FindProxyForURL(url, host) {
if (shExpMatch(host, "graph.microsoft.com") ||
shExpMatch(host, "api.contoso.com")) {
return "PROXY 127.0.0.1:8000";
}
return "DIRECT";
}Limitations:
- PAC files operate at the host level, not URL-path level. Fine-grained URL matching still happens inside the proxy as it does today.
- Linux doesn't have a standard system-wide auto-config URL mechanism (same limitation as the current system proxy setup).
Benefits:
- Non-watched traffic never touches the proxy — faster, fewer side effects
- Could resolve issues with Azure Functions, Teams auth, and other services that break when proxied
- Minimal implementation surface — Dev Proxy already has an API controller and already toggles system proxy settings
Derived from #1368.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels