Events
Microsoft 365 Community Conference
May 6, 2 PM - May 9, 12 AM
Skill up for the era of AI at the ultimate community-led Microsoft 365 event, May 6-8 in Las Vegas.
Learn moreThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dev Proxy is a command line tool that helps you simulate behaviors and errors of cloud APIs to help you build resilient apps.
In this tutorial, you learn how to install and run Dev Proxy.
The easiest way to install Dev Proxy is by using winget. Alternatively, you can install Dev Proxy manually.
To install Dev Proxy using winget, run the following command:
winget install Microsoft.DevProxy --silent
Important
Dev Proxy installer adds a new entry to PATH. To use Dev Proxy after installation, you must restart the command prompt to refresh the PATH environment variable.
The easiest way to install Dev Proxy is by using Homebrew. Alternatively, you can install Dev Proxy manually.
To install Dev Proxy using Homebrew, run the following commands:
brew tap dotnet/dev-proxy
brew install dev-proxy
The easiest way to install Dev Proxy is by using the setup script. Alternatively, you can install Dev Proxy manually.
To install Dev Proxy using the setup script, run the following commands:
bash -c "$(curl -sL https://aka.ms/devproxy/setup.sh)"
If you use PowerShell, run the following command:
(Invoke-WebRequest https://aka.ms/devproxy/setup.ps1).Content | Invoke-Expression
Note
To try the latest preview features, install the beta version of Dev Proxy.
To install Dev Proxy using the setup script, run the following commands:
bash -c "$(curl -sL https://aka.ms/devproxy/setup-beta.sh)"
If you use PowerShell, run the following command:
(Invoke-WebRequest https://aka.ms/devproxy/setup-beta.ps1).Content | Invoke-Expression
To run the beta version of Dev Proxy, use devproxy-beta
The first time you start Dev Proxy on your machine there are a few steps to follow to ensure that Dev Proxy can intercept requests from your machine and respond successfully. You won't have to repeat these steps after the first run.
devproxy
and press Enter.Dev Proxy CA
. A warning shows. Select Yes
to confirm that you want to install the certificate. Dev Proxy uses this certificate to decrypt HTTPS traffic sent from your machine.Allow access
button to allow traffic through the firewall.devproxy
and press Enter.Dev Proxy CA
, which it uses to decrypt HTTPS traffic sent from your machine. A warning shows. Press y to confirm that you want to trust the certificate.Allow
to confirm.Start Dev Proxy. Open a command prompt session. Enter devproxy
and press Enter.
Trust certificate. Dev Proxy uses a custom SSL certificate to decrypt HTTPS traffic sent from your machine.
Important
The following instructions are for Ubuntu. For other Linux distributions, the steps might differ.
To install and trust the certificate, in a new command prompt, run the following commands:
# Export Dev Proxy root certificate
openssl pkcs12 -in ~/.config/dev-proxy/rootCert.pfx -clcerts -nokeys -out dev-proxy-ca.crt -passin pass:""
# Install the certificate
sudo cp dev-proxy-ca.crt /usr/local/share/ca-certificates/
# Update certificates
sudo update-ca-certificates
The command prompt displays the following output:
info 8 error responses loaded from devproxy-errors.json
info Dev Proxy API listening on http://localhost:8897...
info Dev Proxy Listening on 127.0.0.1:8000...
Hotkeys: issue (w)eb request, (r)ecord, (s)top recording, (c)lear screen
Press CTRL+C to stop Dev Proxy
By default, Dev Proxy is configured to:
Dev Proxy intercepts requests that applications on your machine make to URLs that you register with Dev Proxy. When Dev Proxy detects a request, it either passes it through to the API (take no action), or returns a response. Let's confirm that Dev Proxy is working as expected.
In PowerShell, use the Invoke-WebRequest
cmdlet to send a GET request to the JSON Placeholder API.
Invoke-WebRequest -Uri https://jsonplaceholder.typicode.com/posts
If you use curl
, send a GET request to the JSON Placeholder API using the following command.
curl -ikx http://localhost:8000 https://jsonplaceholder.typicode.com/posts
You can also use an API client like Postman to send a GET request to https://jsonplaceholder.typicode.com/posts
.
In the command line where Dev Proxy is running, you see the information about the request and the action that Dev Proxy performed. By default, Dev Proxy simulates an error response with a 50% chance. If your request doesn't return an error, Dev Proxy passes it through.
req ╭ GET https://jsonplaceholder.typicode.com/posts
time │ 1/31/2025 12:12:14 PM +00:00
skip │ RetryAfterPlugin: Request not throttled
skip │ GenericRandomErrorPlugin: Pass through
api ╰ Passed through
If Dev Proxy returns an error response, you see the error message in the output.
req ╭ GET https://jsonplaceholder.typicode.com/posts
time │ 1/31/2025 12:12:37 PM +00:00
skip │ RetryAfterPlugin: Request not throttled
oops ╰ 403 Forbidden
Important
If you don't see any output in the command prompt, it's likely that Dev Proxy isn't intercepting requests. Check the common problems section for help.
When you no longer require Dev Proxy to be running, you should always stop it safely.
If you shut down the command prompt session, Dev Proxy doesn't unregister correctly as the system proxy, and you might experience some common problems.
Learn how to configure Dev Proxy to your needs. Dev Proxy is highly flexible and supports many different scenarios. Learn more about how to configure it to your specific scenario.
Dev Proxy feedback
Dev Proxy is an open source project. Select a link to provide feedback:
Events
Microsoft 365 Community Conference
May 6, 2 PM - May 9, 12 AM
Skill up for the era of AI at the ultimate community-led Microsoft 365 event, May 6-8 in Las Vegas.
Learn moreTraining
Learning path
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization
Certification
Microsoft Certified: DevOps Engineer Expert - Certifications
This certification measures your ability to accomplish the following technical tasks: Design and implement processes and communications, design and implement a source control strategy, design and implement build and release pipelines, develop a security and compliance plan, and implement an instrumentation strategy.