# Twilio has to use proxy for outgoing request | Rasa Whatsapp integration

**URL:** <https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733>\
**Category:** Rasa Open Source\
**Created:** [January 7, 2021, 9:36am UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733 "2021-01-07T09:36:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vin0108](https://avatars.discourse-cdn.com/v4/letter/v/fbc32d/32.png) [@vin0108](https://forum.rasa.com/u/vin0108)\
**Post date:** [January 7, 2021, 9:36am UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733/1 "2021-01-07T09:36:18Z")

</div>

Hey there,

we are trying to use the Twilio for Whatsapp Integration. It is mandatory to use a proxy for outgoing requests. Is there any possibility to configure the connector to use a proxy? Or any modification to the twilio.py file

Always receiving this Error Message:Max Retries exceeded, New Connection error, Unable to reach [api.twilio.py](http://api.twilio.py/)

this is similar to your solution on [Slack connector has to use proxy for outgoing requests in Docker](http://forum.rasa.com/t/slack-connector-has-to-use-proxy-for-outgoing-requests-in-docker/30845) can you kindly help with twilio

Consider all my requests should go via [http://x.x.x.x:1010](http://x.x.x.x:1010) -\> proxy

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![desmarchris](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/desmarchris/32/12277_2.png) [@desmarchris](https://forum.rasa.com/u/desmarchris)\
**Post date:** [January 7, 2021, 7:24pm UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733/2 "2021-01-07T19:24:37Z")

</div>

Hi Vin,

I opened a [github ticket](https://github.com/RasaHQ/rasa/issues/7694) for this request. Are you using Twilio’s [Proxy REST API](https://www.twilio.com/docs/proxy/api)?

---

<div class="post-metadata">

**Author:** ![vin0108](https://avatars.discourse-cdn.com/v4/letter/v/fbc32d/32.png) [@vin0108](https://forum.rasa.com/u/vin0108)\
**Post date:** [January 7, 2021, 7:42pm UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733/3 "2021-01-07T19:42:33Z")

</div>

Thanks for responding, I am not using twilio proxy rest api, there is a proxy server in http:121.2.12.19:1010. I want all the requests (traffic from rasa) to go via that proxy. I feel there has to be a modification in this file [rasa/twilio.py at master · RasaHQ/rasa · GitHub](https://github.com/RasaHQ/rasa/blob/master/rasa/core/channels/twilio.py)

---

<div class="post-metadata">

**Author:** ![desmarchris](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/desmarchris/32/12277_2.png) [@desmarchris](https://forum.rasa.com/u/desmarchris)\
**Post date:** [January 7, 2021, 7:45pm UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733/4 "2021-01-07T19:45:50Z")

</div>

Yes exactly. Do you want to take a crack at it, or do you need more direction on where to add the change?

---

<div class="post-metadata">

**Author:** ![vin0108](https://avatars.discourse-cdn.com/v4/letter/v/fbc32d/32.png) [@vin0108](https://forum.rasa.com/u/vin0108)\
**Post date:** [January 7, 2021, 7:57pm UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733/5 "2021-01-07T19:57:43Z")

</div>

I need help for sure 🙂 please guide me on where to make changes and what to add?

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [January 7, 2021, 9:43pm UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733/6 "2021-01-07T21:43:22Z")

</div>

It sounds like you’re need it to work as described [here](https://github.com/twilio/twilio-python/issues/409) and [here](https://github.com/twilio/twilio-python/pull/500). Is that right?

If so, I think you’d add the `TwilioHttpClient` call with your proxy [here](https://github.com/RasaHQ/rasa/blob/957de844129011b9a346fb9d0154e1414dedba26/rasa/core/channels/twilio.py#L28).

Give that a try and if it works for you, send us a PR. Maybe this proxy call is only made if you specify `proxy_endpoint` or something like that in the endpoints.yml:

```auto
twilio:
  account_sid: "ACbc2dxxxxxxxxxxxx19d54bdcd6e41186"
  auth_token: "e231c197493a7122d475b4xxxxxxxxxx"
  twilio_number: "+440123456789" # if using WhatsApp: "whatsapp:+440123456789"
  proxy_endpoint: "http://121.2.12.19:1010"

```

---

<div class="post-metadata">

**Author:** ![vin0108](https://avatars.discourse-cdn.com/v4/letter/v/fbc32d/32.png) [@vin0108](https://forum.rasa.com/u/vin0108)\
**Post date:** [January 18, 2021, 7:32am UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733/7 "2021-01-18T07:32:48Z")

</div>

Hey, I added the httpclient, it works, Thank you so much.

---

<div class="post-metadata">

**Author:** ![vaidehi](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vaidehi](https://forum.rasa.com/u/vaidehi)\
**Post date:** [September 22, 2022, 7:50am UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733/8 "2022-09-22T07:50:46Z")

</div>

Hi Vin can you share how this was achived

---

<div class="post-metadata">

**Author:** ![vaidehi](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vaidehi](https://forum.rasa.com/u/vaidehi)\
**Post date:** [September 22, 2022, 11:53am UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733/9 "2022-09-22T11:53:35Z")

</div>

How and where did u add ? I tried adding it says http\_client is not attribute of TwilioOutput

---

<div class="post-metadata">

**Author:** ![vaidehi](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@vaidehi](https://forum.rasa.com/u/vaidehi)\
**Post date:** [September 22, 2022, 11:54am UTC](https://forum.rasa.com/t/twilio-has-to-use-proxy-for-outgoing-request-rasa-whatsapp-integration/38733/10 "2022-09-22T11:54:04Z")

</div>

Need help here @stephens
