Repository navigation
DevProxy not intercepting localhost requests when api is launched from Visual Studio 2022 #1403
Description
Activity
Thanks for reaching out and sorry to hear you're getting stuck. Could it be that Windows' proxy settings override Edge's proxy bypass list? If I recall correctly, you can also configure proxy bypass list in Windows' Internet settings.
neil-thompson-schemeserve commented
on Oct 1, 2025 AuthorMore actionsIn Control Panel > Network and Internet > Internet Options
Connections tab > LAN Settings > Proxy Server> Advanced > ExceptionsI added
localhost:60309, but this hasn't helped.
Also tried ticking "Bypass proxy server for local addresses" - no joyThanks though :)
Reacted by Waldek MastykarzThanks for confirming. We'll check it out and get back to you asap.
I've followed your steps and it seems to be working just fine for me:
Here is my devproxyrc.json:
{ "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.2.0/rc.schema.json", "plugins": [ { "name": "GenericRandomErrorPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll", "configSection": "weatherApiErrors" } ], "urlsToWatch": [ "https://localhost:7232/*" ], "weatherApiErrors": { "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.2.0/genericrandomerrorplugin.schema.json", "errorsFile": "weather-api-errors.json" } }And the weather-api-errors.json:
{ "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.2.0/genericrandomerrorplugin.errorsfile.schema.json", "errors": [ { "request": { "url": "https://localhost:7232/WeatherForecast*" }, "responses": [ { "statusCode": 500, "headers": [ { "name": "content-type", "value": "application/json; charset=utf-8" } ], "body": { "type": "https://tools.ietf.org/html/rfc7231#section-6.6.1", "title": "An error occurred while processing your request.", "status": 500, "detail": "Internal server error - weather service temporarily unavailable" } }, { "statusCode": 503, "headers": [ { "name": "content-type", "value": "application/json; charset=utf-8" }, { "name": "retry-after", "value": "30" } ], "body": { "type": "https://tools.ietf.org/html/rfc7231#section-6.6.4", "title": "Service Unavailable", "status": 503, "detail": "Weather service is temporarily overloaded. Please retry after 30 seconds." } }, { "statusCode": 429, "headers": [ { "name": "content-type", "value": "application/json; charset=utf-8" }, { "name": "retry-after", "value": "60" } ], "body": { "type": "https://tools.ietf.org/html/rfc6585#section-4", "title": "Too Many Requests", "status": 429, "detail": "Rate limit exceeded. Please wait 60 seconds before making another request." } }, { "statusCode": 502, "headers": [ { "name": "content-type", "value": "application/json; charset=utf-8" } ], "body": { "type": "https://tools.ietf.org/html/rfc7231#section-6.6.3", "title": "Bad Gateway", "status": 502, "detail": "Unable to connect to weather data provider" } } ] } ] }The only thing I had to change was to fix quotes around arguments:
--proxy-bypass-list="<-loopback>" --proxy-server="127.0.0.1:8000"(the closing quote behind loopback was missing)- locked and limited conversation to collaborators
on Oct 2, 2025
It's not clear to me how to get devProxy to intercept localhost requests when debug session launched from Visual Studio 2022 Pro. Requests made to https://jsonplaceholder.typicode.com are intercepted fine.
I have an asp net core web api that will launch on localhost:60309, and a sample ping endpoint
GET https://localhost:60309/ss/ping
I launch devproxy with a config file, which includes the port, an ExecutionSummaryPlugin and a reporter (all fine for jsonplaceholder.typicode.com)
I've updated VS through the "Browse with..." dialog to Add a new browser,
FriendlyName: "EdgeProxy"
Program: "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
Arguments: --proxy-bypass-list="<-loopback> --proxy-server="127.0.0.1:8000"`
I make sure no instance of edge is running. Click the Debug option in VS, choosing "EdgeProxy", which launches msedge with the API running - but devProxy never intercepts any requests to GET https://localhost:60309/ss/ping (made via a VSCode .http and from Postman)
Where am I going wrong?
I have tried variants of using the build in server. IISExpress, Debug, "Start without Debugging" - no variant has the proxy.
I have also tried just starting edge using Run: msedge --proxy-bypass-list="<-loopback> --proxy-server="127.0.0.1:8000
The choosing Edge as the browser in VS, which launches the app in a new tab of the browser launched from Run. Doesn't intercept.
Windows 11, all up to date. Any suggestions welcome.
A walkthrough would be amazing, if anyone else has got this to work.