Reputation: 21
I am trying to debug a bot which is running locally, and when i use the ngrok url on bot emulator it is returning the following error "The bot is remote, but the service URL is localhost. Without tunneling software you will not receive replies".
Any help please? thank you.
Upvotes: 1
Views: 4139
Reputation: 2885
If you are running locally you do not need to use ngrok. You just need a single .bot file with the endpoint URL http://localhost:3978/api/messages
. You should not enter the App ID and Password since you are running locally (your bot won't connect otherwise, and may be why you are seeing that message). I use this single .bot file for every bot I test locally, the only reason you would need to change is if you're listening on different ports for some reason.
To test:
node index.js
. If you are using the MS templates and haven't changed any settings, you'll see a message that the bot is not listening on port 3978.http://localhost:3978/api/messages
endpointNote that if you are testing behind a corporate firewall and you are using services like LUIS, QnA Maker, etc., those calls will likely be blocked and the bot will error out. You do not need ngrok to fix this! The easiest way is to set your proxy via HTTPS_PROXY in your .env file (you can define it in your code too via process.env.HTTPS_PROXY but I don't recommend that since you don't want that setting in production).
Do not also set HTTP_PROXY, I'm not entirely sure why but this will prevent your bot from working.
Note that some of the native botframework connectors, like CosmosDB, don't respect the .env HTTPS_PROXY variable and those calls will fail. If you are making those API calls directly, you shouldn't have any issues.
Upvotes: 1