Brad
Brad

Reputation: 87

Python flask app running on Pythonanywhere not able to send whatsapp messages through ngrok and twilio

My ngrok tunnel web interface is http://127.0.0.1:4040. However, I am not able to open the interface as it says 127.0.0.1 refused to connect. So I am not able to get the webhook link from the interface to add to Twilio Sandbox. Hence my python flask app is not able to reply back to messages. The app is python code using flask. It replies to whatsapp messages through Twilio API using ngrok tunnel. The code works fine in my local computer. However I added the Forwarding Link "https://c664-54-226-131-176.ngrok-free.app" to Twilio sandbox and found that when a whatsapp message is sent to the app, in pythonanywhere I see the following:

HTTP Requests

POST /twilio However, the reply message is not shooted back. Please help to fix this issue.

Upvotes: 0

Views: 152

Answers (1)

HCook886
HCook886

Reputation: 61

PythonAnywhere blocks almost every ip address of requests going out for free tier users, and this is probably the case. Here is a similar question on their forums and the whitelist of allowed websites. Good luck!

Upvotes: 0

Related Questions