microsoft / dev-proxy

Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path.
https://aka.ms/devproxy
MIT License
471 stars 56 forks source link

[BUG]: Only works (for me) in Powershell #846

Closed white-label-development closed 1 month ago

white-label-development commented 1 month ago

Description

Installed via winget. updated devproxyrc.json with "rate": 100, If I use powershell devproxy works. If I use anything else it doesn't.

Expected behaviour

I'd expext request using curl from the command prompt to go through devproxy and an error returned. I'd expect the same for httpClient requests from inside my .NET app.

Actual behaviour

Windows Terminal Powershell Invoke-WebRequest -Uri https://jsonplaceholder.typicode.com/posts/1 returns an error via devProxy, as expected

Windows Terminal Command Prompt curl -X GET https://jsonplaceholder.typicode.com/posts/1 always returns a 200 Json response

.NET App HttpClient request to https://jsonplaceholder.typicode.com/posts/1 always gets a Json response

Steps to reproduce

I've followed the docs at https://learn.microsoft.com/en-gb/microsoft-cloud/dev/dev-proxy/overview

I guess it's my machine but I can't see how? Not sure how to investigate the issue further. All suggestions welcome

Dev Proxy Version

0.19.1

Operating system (environment)

Windows

Shell

cmd

Configuration file

It's the default, except with "rate": 100,

Additional Info

No response

waldekmastykarz commented 1 month ago

If I'm not mistaken, curl doesn't automatically pick up Windows proxy settings. So instead, you need to either configure proxy using the environment variable http_proxy or specify proxy in curl like curl -ix http://127.0.0.1:8000 https://jsonplaceholder.typicode.com/posts