botframework - Ngrok 在隧道传输我的本地主机时返回 405 错误

标签 botframework remote-access http-status-code-405 ngrok http-tunneling

我有一个网络应用程序机器人,我想对其进行远程控制,以便一些人可以对其进行测试。我正在使用 Bot Framework Emulator 在本地测试它并且它产生了奇迹,但我完全没有让 ngrok 托管它。

(我实际上是使用...azurewebsites.net/api/messages 链接我的应用程序在 Azure 中与另一个机器人的链接来实现的,但我不能使用这个链接,所以我正在尝试使用 ngrok 为我提供的链接 - 两者我管理的机器人和这个机器人托管在 Azure 中,但我不知道如何使其可用于远程访问)

我正在采取的步骤:

  • 在 Visual Studio 中部署应用程序,使其在 localhost:3979 上运行;
  • 使用 ngrok 3979 http -host-header=rewrite localhost:3979 在 ngrok 中从外部打开端口;
  • 获取 ngrok 为我提供的转发 URL 之一,例如https://3d609207.ngrok.io
  • 在 Bot Framework Emulator 中插入上一个 URL;
  • 单击连接。

  • 在 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

    https://your_bots_hostname/api/messages



    但是我无法在 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,我可以在我这边重现这个问题作为消息端点。

    enter image description here

    请尽量指定https://xxxxxxxx.ngrok.io/api/messages作为消息端点,这对我有用。

    enter image description here

    关于botframework - Ngrok 在隧道传输我的本地主机时返回 405 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48489282/

    相关文章:

    linux - 尝试在远程服务器: "Permission denied"上执行脚本(创建文件夹)

    asp.net-web-api - Ajax 邮政 : 405 Method Not Allowed

    Angular 7 : Sending post request gives error 405 (Method not allowed)

    c# - 在 Azure 中将机器人从 Node 更改为 C#

    c# - 如何在两个不同语言的 luis.ai 对话框之间切换

    botframework - 发送图像而不是链接

    c# - 我们可以使用 Putty 捕获远程屏幕(如屏幕录像机)吗?

    c# - 如何在 Microsoft Bot 框架服务器端打开 Internet 选项卡?

    version-control - 如何使用 PHPStorm 处理大量远程文件