BotFramework-Emulator: Emulator doesn't recognize localhost

Github issues should be used for bugs and feature requests. Use Stack Overflow for general “how-to” questions.

Version

4.4.2

Describe the bug

My bot is run though http://localhost:3978/api/messages, which I can confirm through trying to connect to the port in browser. However, the emulator is not recognizing the port. Regardless of whether or not the bot is running, I get the same error log:

[08:52:02]Emulator listening on http://localhost:61074 [08:52:02]ngrok not configured (only needed when connecting to remotely hosted bots) [08:52:02]Connecting to bots hosted remotely [08:52:02]Edit ngrok settings [08:52:02]The bot's Microsoft App Id or Microsoft App Password is incorrect. [08:52:02]POSTdirectline.conversationUpdate [08:52:02]The bot's Microsoft App Id or Microsoft App Password is incorrect. [08:52:02]POSTdirectline.conversationUpdate [08:52:02]POST200directline.startConversation [08:53:17]-> messagehello [08:53:17]POST400directline.postActivity

To Reproduce

Steps to reproduce the behavior:

  1. Get EchoBot sample code (from either Azure or Framework Template)
  2. Start debugging
  3. Obtain localhost address shown by browser page
  4. In bot emulator, press “Open Bot” and enter localhost address, as well as AppId and password obtained from appsettings.json file.
  5. Click connect

Expected behavior

The log appears as above, with any input messages giving the same POST 400 error.

Additional context

I have tried the following potential solutions with no luck:

  1. Download clean version of the echo bot
  2. Leave blank, comment out, or delete AppId and Password
  3. Reinstall Visual Studio
  4. Reinstall packages
  5. Build the echo bot from command line instead of Visual Studio
  6. Try “create a new bot configuration”, which just gives an infinite “connecting” message
  7. Try previous versions of the emulator

I have also documented the problem on Stack Overflow: https://stackoverflow.com/questions/56529611/bot-emulator-error-post-400-directline-postactivity

[bug]

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

Hi @khiemnvd ,

Try setting the HTTPS_PROXY environment variable with the address of your proxy, and then try using the Emulator to connect to your bot. (I would recommend restarting the Emulator after setting the variable)

Ex: set HTTPS_PROXY=http://[proxy-address][:port]

Closing due to inactivity.