简体   繁体   English

如何生成固定的webhook网址?

[英]How to generate fixed webhook url?

I am using Twilio to send and receive SMS messages from a Python application. 我正在使用Twilio从Python应用程序发送和接收SMS消息。 The issue is that their tutorials use ngrok as a way to get through the firewall but I don't want to have to run ngrok every time I run my app and the URL changes every time ngrok runs so I have to change the webhook url on Twilio every time. 问题是他们的教程使用ngrok作为穿越防火墙的一种方式,但是我不想每次运行我的应用程序都必须运行ngrok,并且每次ngrok运行时URL都会改变,因此我必须更改webhook网址每次都Twilio。 Is there a better way around this? 有没有更好的办法解决这个问题? Is this something that requires a server? 这需要服务器吗?

There are two options that you have. 您有两个选择。

  1. The paid option of ngrok allows you to set a persistent url so that you don't have to chance the webhook url on Twilio each time. ngrok的付费选项允许您设置一个持久URL,这样就不必每次都在Twilio上使用webhook url。

  2. If you have a server, then you would also be able to set a persistent url to your server. 如果您有服务器,则还可以为服务器设置一个持久URL。

Unfortunately, the free version of ngrok does not allow you to set a persistent url. 不幸的是,ngrok的免费版本不允许您设置永久性URL。

You can look at going Serverless with Twilio Functions (Node.js/JavaScript). 您可以看看使用Twilio函数(Node.js / JavaScript)实现无服务器化。

Building Apps with Twilio Functions https://support.twilio.com/hc/en-us/articles/115007737928-Building-apps-with-Twilio-Functions 使用Twilio功能构建应用程序https://support.twilio.com/hc/en-us/articles/115007737928-Building-apps-with-Twilio-Functions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM