默认情况下,开发人员代理在命令提示符中显示其消息。 如果您使用开发代理与发出大量请求的应用程序配合使用,可能会很难找到您感兴趣的消息。 更重要的是,你可能想要检查开发人员代理截获的请求和响应。
若要更轻松地查找感兴趣的消息,请使用 DevToolsPlugin
插件在 Chrome DevTools 中显示开发代理消息。
小窍门
开发代理支持将 Chrome DevTools 与 Microsoft Edge、Microsoft Edge Dev 和 Google Chrome 配合使用。
该 DevToolsPlugin
公开了 Dev Proxy 消息,以及在 Chrome DevTools 中截获的请求和响应的信息。
将 Chrome DevTools 与开发代理配合使用:
打开位于您的 Dev Proxy 安装目录中的 devproxyrc.json 文件。 也可使用
devproxy config open
命令。通过将以下片段添加到
plugins
数组中,启用DevToolsPlugin
插件。{ "name": "DevToolsPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll", "configSection": "devTools" }
添加分区
devTools
并指定首选浏览器:"devTools": { "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/devtoolsplugin.schema.json", "preferredBrowser": "Edge" }
小窍门
支持的值包括:
Edge
、、EdgeDev
Chrome
完整
devproxyrc.json
文件如下所示:{ "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/rc.schema.json", "plugins": [ { "name": "DevToolsPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll", "configSection": "devTools" } ], "devTools": { "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/devtoolsplugin.schema.json", "preferredBrowser": "Edge" } }
保存
devproxyrc.json
文件,然后启动开发代理。