Open mydiemho opened 5 years ago
I worked with My on this and experienced the same thing for myself.
Specifically, if you look at the ngrok traces, the external traffic coming in from the Bot Framework Service is ending up getting 404
statuses finding /api/messages
. The endpoint is definitely there though because we can hit it through localhost
no problem. Additionally, we can uncheck the "Bypass ngrok for local addresses" option and watch the emulator send requests through ngrok successfully where as an external channel such as Web Chat still fails with the aforementioned 404
.
~My guess is that the emulator is not actually configuring the Host
header when it runs ngrok and this results in the request not being able to be handled by the local server software because the Bot Framework Service will use the ngrok hostname.~
UPDATE: I just thought to check the Host
header coming from each via the ngrok traces and they are always the ngrok Host in both the WebChat case and emulator as a client (with bypass off) case.
Emulator sending a message through ngrok
Portal Test WebChat sending a message through ngrok
In the above screenshots we can see that emulator is sending calls to the directline endpoint and that seems to be what is exposed by the ngrok endpoint vs the Test WebChat channel sending through the Bot Framework Service and just trying to deliver the activity to the bot's endpoint at /api/messages
.
So... obviously what's exposed over ngrok is not the bot endpoint, but rather the emulator's DirectLine endpoint??? Is this expected???
For anyone coming into this issue right now, the answer is don't use the emulator and run ngrok manually from the command line like so:
> ngrok http 1234 -host-header="localhost:1234"
Where you replace the 1234
s with your bot's local server port (e.g. 3978
).
Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.
Version
What version of the Emulator are you using.
V4
Describe the bug
Setting up channel debug locally through emulator does not work
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It just works.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
It works fine when I start ngrok manually following this instruction
[bug]