Use Proxy while testing

Hello everyone. I already know how to set Proxy in postman Settings - it’s fine if i set it before tests started, or before sending a request. Can i set or change Proxy while testing ? May be I can set proxy in postman sandbox via Java Script, like this :

pm.sendRequest({url:"https://adres", method:'Post', header:header, body:body, proxy:"1.1.1.1:80"}, 
?

UPD : on which language was written pm.sendRequest command ? Can I look at source code ?

1 Like

Proxy cannot be set programmatically yet. I will look into how feasible that would be.

1 Like

You mean that this feature cannot be feasible in app or we have some variants ?

Looks like this thread has run cold a bit so I would like to rekindle it.

We could really do with a rapid way of switching proxies in-line rather than interrupting flow to change settings.

We have different proxy requirements when using different levels of server environment, and again when using VPN.

Having to re-enter the proxy each time is a hold-up, and it means also keeping a cut and paste source for the right proxy for the ecosystem.

Being able to manage a drop down list of proxies would be an option.
Being able to programmatically set a proxy using an environment variable would be a more dynamic solution.
Being able to test a list of proxies and apply the proxy that works for your current situation would be more dynamic still…