0
votes

I wanted to try the new bot framework by microsoft. I made a simple bot and registered it in bot connector. When I now want to test my bot on the dev.framework.com site I get this message back:

{
 "error": {
    "code": "Internal",
    "message": "An error occurred while sending the request. Unable to connect to the remote server An attempt was made to access a socket in a way forbidden by its access permissions 172.17.1.41:3978  [GSisZ6ZkL7d]",
    "statusCode": 500
 }
}

This is my app.js:

var builder = require('botbuilder');
var restify = require('restify');
var index = require('./dialogs/index.js');

var bot = new builder.BotConnectorBot({ appId: 'myAppId', appSecret: 'myAppSecret' });
bot.add('/', index);

var server = restify.createServer();
server.post('/api/messages',  bot.listen());
server.listen(process.env.port || 8080, process.env.ip, bot.verifyBotFramework(), function () {
    console.log('%s listening to %s', server.name, server.url); 
});

When I run my app on openshift I get the console log "restify listening to https://myipaddress:8080", so I guess my node app is working.

I also tried both https and http as endpoint with calling the bot.verifyBotFramework() and without.

2
Seems like the endpoint maps to the incorrect port (3978) but OpenShift may allow port 8080 only to connect from the public web? - Eugene

2 Answers

0
votes

Try using http instead of https for local emulator

0
votes

the bot.verifyBotFramework() call is only going to kick in over HTTPS and will return a 403 if your AppID or AppSecret are wrong. If you trying to call in through the actual Bot Connector service I can guarantee they're wrong but they should work ok with the emulator. I'm not sure why you're getting a 500 error though. Other then the AppID & AppSecret being the default used by the emulator everything looks ok to me.