Closed waldekmastykarz closed 1 week ago
Here's sample configuration that we could use:
{
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v0.22.0/rc.schema.json",
"plugins": [
{
"name": "DevToolsPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
"configSection": "devTools"
},
{
"name": "RewritePlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
"configSection": "rewritePlugin"
}
],
"urlsToWatch": [
"https://jsonplaceholder.typicode.com/*",
"https://jsonplaceholder.typicode.local/*",
"http://jsonplaceholder.typicode.com/*",
"http://jsonplaceholder.typicode.local/*"
],
"rewritePlugin": {
"rewritesFile": "devproxy-rewrites.json"
},
"devTools": {
"preferredBrowser": "Edge"
},
"rate": 50,
"logLevel": "information",
"newVersionNotification": "stable",
"showSkipMessages": true
}
{
"rewrites": [
{
"in": {
"host": "jsonplaceholder.typicode.local",
"protocol": "http"
},
"out": {
"host": "jsonplaceholder.typicode.com",
"protocol": "https"
}
}
]
}
Rewriting the host is optional, but we'd use it to match rewrites to requests, so if you don't want to change the host, you could use the same host name in the in and out definition.
If you are using the MS Dev Tunnels tool, you can already inspect incoming requests at: https:/<tunnel_id>-<port>-inspect.usw2.devtunnels.ms/
The CLI output should write the actual URL where you can view the insecpt
That's a good point! As a developer, you can choose if you want to just check the incoming request into the tunnel or the rewritten request going into the target cloud API.
Offer a plugin that allows to pass through requests to a backend API. This would be invaluable for debugging/examining API requests in cloud service integration scenarios, where a cloud service calls a remote API and you want to examine what's on the request and response.
The usage scenario would be as follows:
you start a dev tunnel on a local machine
you register the tunnel URL with the cloud service calling the API
you configure the pass through dev proxy plugin to pass requests to the dev tunnel URL to a specified target URL
when the cloud service calls the dev tunnel, the pass through plugin picks up the request, changes its URL to the target backend URL, passes the request through
users can examine the data about the intercepted request and returned response using the DevToolsPlugin
[x] build plugin
[ ] add schema