我有一个网络应用程序机器人,我想对其进行远程控制,以便一些人可以对其进行测试。我正在使用 Bot Framework Emulator 在本地测试它并且它产生了奇迹,但我完全没有让 ngrok 托管它。
(我实际上是使用...azurewebsites.net/api/messages 链接我的应用程序在 Azure 中与另一个机器人的链接来实现的,但我不能使用这个链接,所以我正在尝试使用 ngrok 为我提供的链接 - 两者我管理的机器人和这个机器人托管在 Azure 中,但我不知道如何使其可用于远程访问)
我正在采取的步骤:
ngrok
3979 http -host-header=rewrite localhost:3979
在 ngrok 中从外部打开端口; https://3d609207.ngrok.io
在 ngrok 和 Bot Framework Emulator 中都返回我
405 Method Not Allowed
.我尝试访问我在 Bot Framework Emulator 中插入的链接,我通常拥有在本地托管我的机器人时会看到的页面:
Describe your bot here and your terms of use etc.
Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to
但是我无法在 Bot Framework Emulator 中发送或接收消息。
此外,ngrok 在 HTTP 请求标题下打印:
HTTP Requests
-------------
POST / 405 Method Not Allowed
GET /favicon.ico 200 OK
GET / 200 OK
我的 MSAppID 和密码在 web.config 中正确配置,编译没有错误,所以我怀疑它是代码上的东西(除非代码中有一些配置阻止了这个机器人被远程访问,但我有不知道)。
我非常感谢在这个问题上的任何帮助。谢谢你的时间。
最佳答案
Both in ngrok and in Bot Framework Emulator returns me 405 Method Not Allowed
如果我只提供
https://xxxxxxxx.ngrok.io
,我可以在我这边重现这个问题作为消息端点。请尽量指定
https://xxxxxxxx.ngrok.io/api/messages
作为消息端点,这对我有用。关于botframework - Ngrok 在隧道传输我的本地主机时返回 405 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48489282/