# Use Proxy while testing

**URL:** <https://community.postman.com/t/use-proxy-while-testing/2000>\
**Category:** Help Hub\
**Tags:** proxy, tests\
**Created:** [June 29, 2018, 12:48pm UTC](https://community.postman.com/t/use-proxy-while-testing/2000 "2018-06-29T12:48:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alter.22.04](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@alter.22.04](https://community.postman.com/u/alter.22.04)\
**Post date:** [June 29, 2018, 12:48pm UTC](https://community.postman.com/t/use-proxy-while-testing/2000/1 "2018-06-29T12:48:50Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![shamasis](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/shamasis/32/53_2.png) [@shamasis](https://community.postman.com/u/shamasis)\
**Post date:** [July 3, 2018, 1:07am UTC](https://community.postman.com/t/use-proxy-while-testing/2000/2 "2018-07-03T01:07:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![alter.22.04](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@alter.22.04](https://community.postman.com/u/alter.22.04)\
**Post date:** [July 3, 2018, 10:01am UTC](https://community.postman.com/t/use-proxy-while-testing/2000/3 "2018-07-03T10:01:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![GIGAMAC](https://avatars.discourse-cdn.com/v4/letter/g/aca169/32.png) [@GIGAMAC](https://community.postman.com/u/GIGAMAC)\
**Post date:** [July 28, 2019, 8:18am UTC](https://community.postman.com/t/use-proxy-while-testing/2000/4 "2019-07-28T08:18:23Z")

</div>

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…
