UrlDiscoveryPlugin

Creates a list of URLs that Dev Proxy intercepted. Use this plugin to learn which URLs your app is calling and how to configure the Dev Proxy to simulate behaviors for them.

Tip

To save the summary to a file, use a reporter plugin in your configuration.

Screenshot of a split command prompt window. On the left side, Dev Proxy output showing intercepted requests. On the right side, generated report with intercepted URLs.

Configuration example

{
  "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v4.0.0/rc.schema.json",
  "plugins": [
    {
      "name": "UrlDiscoveryPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
    }
  ]
}

Configuration properties

None

Output

UrlDiscoveryPlugin creates its report when you stop recording. The report contains the unique URLs of the requests that Dev Proxy intercepted, sorted alphabetically. Each URL is the full request URL, including its query string.

To save the report as JSON, add the JsonReporter after UrlDiscoveryPlugin in your configuration. JsonReporter writes the report to a file named UrlDiscoveryPlugin_JsonReporter.jsonc in the current working directory. If the file already exists, Dev Proxy appends a timestamp to the file name, for example UrlDiscoveryPlugin_JsonReporter_20261105104151.jsonc.

The file is a JSON with comments (JSONC) file that you can use as a starting point for the urlsToWatch property in your Dev Proxy configuration. The file contains comments that explain how to use wildcards and exclude URLs, followed by a urlsToWatch array with the intercepted URLs:

{
  // Wildcards
  // 
  // You can use wildcards to catch multiple URLs with the same pattern.
  // For example, you can use the following URL pattern to catch all API requests to
  // JSON Placeholder API:
  // 
  // https://jsonplaceholder.typicode.com/*
  // 
  // Excluding URLs
  // 
  // You can exclude URLs with ! to prevent them from being intercepted.
  // For example, you can exclude the URL https://jsonplaceholder.typicode.com/authors
  // by using the following URL pattern:
  // 
  // !https://jsonplaceholder.typicode.com/authors
  // https://jsonplaceholder.typicode.com/*
  "urlsToWatch": [
    "https://jsonplaceholder.typicode.com/posts",
    "https://jsonplaceholder.typicode.com/users",
    "https://jsonplaceholder.typicode.com/users/1"
  ]
}
Property Description
urlsToWatch Array of strings. The unique URLs of the requests that Dev Proxy intercepted while recording, sorted alphabetically. The URLs don't contain wildcards

Important

Because the file contains comments, standard JSON parsers, like JSON.parse in JavaScript or jq, fail to parse it. To read the file in a script, use a parser that supports comments, like JSON5 or the jsonc-parser npm package, or strip the comment lines before parsing the file.

See also

Next step