BotFramework-Emulator icon indicating copy to clipboard operation
BotFramework-Emulator copied to clipboard

Cannot connect the Bot Framework Emulator to a bot running on another machine inside my network without ngrok

Open tasdienes opened this issue 8 years ago • 21 comments

I would like users inside my network to be able to connect the Bot Framework Emulator to a bot running on another machine inside my network. This is possible with ngrok, but it seems like ngrok should not be required since all of the machines are on the same LAN. Also, ngrok is a security concern.

It appears that older versions of the emulator had a setting for "Emulator Url" which looks like it might have been useful for this, but that setting is not present in the current version (3.5).

tasdienes avatar Feb 21 '17 22:02 tasdienes

It is true this was a feature of early versions of the emulator. It was a source of confusion for users, and at the time its value wasn't clear, but based on your feedback and that of others, it's clear we need to bring it back.

eanders-ms avatar Feb 24 '17 17:02 eanders-ms

I am trying to get Bot Emulator talking to a bot service on another machine, but within my corp network, using ngrok. Though I have Bot Emulator -> App settings on my client point to ngrok, I keep getting an error for the callback URL and I am asked to configure ngrok.

ghost avatar Mar 01 '17 19:03 ghost

@sriharim25 In your emulator log, near the top, do you see an entry that states ngrok was started, or failed to start?

eanders-ms avatar Mar 01 '17 20:03 eanders-ms

This is what I see: [14:06:03] Error: The bot is remote, but the callback URL is localhost. Without tunneling software you will not receive replies. [14:06:03] Fix it: Configure ngrok [14:06:03] Learn more: Connecting to bots hosted remotely

ghost avatar Mar 01 '17 22:03 ghost

I am seeing this "Failed to start ngrok: panic" in the logs, identical stack trace to this react error: https://github.com/react-boilerplate/react-boilerplate/issues/465

My emulator is running on Mac OS X and my Node.js server is on a linux tower.

ghost avatar Mar 01 '17 22:03 ghost

What version of ngrok do you have installed? Versions older than 2.1.18 are known to be incompatible with the emulator.

eanders-ms avatar Mar 01 '17 22:03 eanders-ms

I am using the latest version 2.1.18

ghost avatar Mar 02 '17 00:03 ghost

Hi I also got the same error.

Log [10:23:15] Error: The bot is remote, but the callback URL is localhost. Without tunneling software you will not receive replies. [10:23:15] Fix it: Configure ngrok [10:23:15] Learn more: Connecting to bots hosted remotely

Please reply if you got the solution.

ghost avatar Mar 07 '17 05:03 ghost

@sumitdobhal It looks like you're trying to connect to a bot running remotely, but not running the ngrok tunneling software. In the emulator App Settings, do you have your path to ngrok configured?

eanders-ms avatar Mar 19 '17 03:03 eanders-ms

@eanders-MS I have a similar problem. I have succesfully registered a bot, running on a remote machine, in the Bot Framework. The WebChat channel works fine.

Now I want to connect to my registered endpoint using the Bot Framework Channel Emulator for debugging purposes. However, my personal computer is behind a corporate proxy and I'm using CNTML running on localhost:3128 in order to allow all my dev tools to connect to the internet.

When I launch the emulator, ngrok is started successfully and the emulator listens on a random port. When trying to connect to my bot endpoint with my AppID and Password, I get the error message

->POST tunneling socket could not be established, statusCode=403

Somehow ngrok collides with cntlm. And I can't configure ngrok in the emulator to run on a specific port or even behind our corporate proxy (e.g. by using arguments in the ngrok settings of the emulator). If I was able to provide the emulator endpoint, I could create a tunnel in cntlm. But it feels like the emulator's logic requires you to use ngrok, whenever you try to connect to a remote bot, without any regard to existing tunnels. Am I correct here?

i-emre avatar Apr 05 '17 13:04 i-emre

@i-emre Thanks for adding your use case here. You are correct, this is a limitation in the current emulator. We have two changes planned that I believe will cover this issue:

  1. Ability to override the emulator's host and/or port.
  2. Ability to override the serviceUrl (where the bot sends replies)

eanders-ms avatar Apr 05 '17 15:04 eanders-ms

@eanders-MS Thanks for your reply. Those two changes would be much appreciated.

i-emre avatar Apr 06 '17 09:04 i-emre

@eanders-MS Any update on this one. I agree we should be able to connect to the emulator in corporate network as ngrok is blocked due to security concern.

trungngv avatar Sep 22 '17 02:09 trungngv

👍 for being able to configure which port the emulator should listen on, so that when developing locally with docker you can expose it without relying on ngrok

jbuchacher avatar Oct 07 '17 16:10 jbuchacher

  • download https://ngrok.com/ exe.
  • and configure the path of exe in emulator

Neeilk avatar Feb 11 '18 19:02 Neeilk

Hi, I got the same error, and solved with this trick on Mac OS.

After setting the app on emulator with path/ngrok, I changed it to from path/ngrok to path/ngrok.exe. Then, I got this message:

Failed to start ngrok: spawn path/ngrok.exe ENOENT The path to ngrok may be incorrect.

I rechanged from path/ngrok.exe to path/ngrok and it worked.

daeunnpark avatar Aug 11 '18 05:08 daeunnpark

Hi Team,

while deploying the bot in in Local PC by using Bot Emulator, getting the below error.

Error: The bot is remote, but the service URL is localhost. Without tunneling software you will not receive replies. Connecting to bots hosted remotely Edit ngrok settings POST 201 directline.startConversation

Looking the Resolution on this one.

Regards, Tharak

tharakp avatar Nov 01 '18 10:11 tharakp

This request is going on 2 years now. Is there a plan to address this and by when?

vseanclark avatar Mar 29 '19 14:03 vseanclark

I must I'm finding extreme difficulty in producing reliable solutions with Microsoft's bot framework. Really poor quality from a documentation, code quality, overall integration and simplicity point of view.

archmangler avatar Feb 24 '20 14:02 archmangler

its 2021 , now any way to provide custom call back URL in bot emulator? so we can exclude ngrok.

umerazeemalgo avatar Feb 01 '21 14:02 umerazeemalgo

Greetings. We'll take this as a backlog item to prioritize, however we cannot provide an ETA when this will be possible. We would happily accept a community contribution enabling this functionallity.

cwhitten avatar Feb 25 '21 23:02 cwhitten

Any updates? This appears to still be broken many years later

Quazmoz avatar Feb 12 '24 13:02 Quazmoz

There are a lot of security concerns on exposing Emulator like this. There is no access control on the Emulator side which means everyone in the local network would have access to the emulator instance.

That's why we limit access to Emulator APIs to the localhost only, and will likely not implement anything to bypass the limitation on our side.

OEvgeny avatar Feb 12 '24 22:02 OEvgeny