2

I have created a bot using Microsoft bot framework (NodeJs) , it working fine on local system. When i deployed with azure functions then also its working fine.

But i'm trying to deploy in some other way like

1) I want to register my bot on azure 
2) but want to host somewhere else(SSL Certified server) i.e not on azure (don't want to use azure bot functions) 

I have followed the steps got in some articles

enter image description here

My App.js Looks like this

enter image description here

But i'm getting below error when i tried to test with "Test in web Chat"

enter image description here

Can anyone please help me, what i'm doing wrong here ??

Thanks

  • 1
    It's listening on port 80 when deployed to App Service. Just remove the port from your Messaging Endpoint definition and it should start talking back to you. – evilSnobu Feb 21 '18 at 12:30
  • oh, my bad, it's NOT on Azure. make sure you have a valid TLS certificate on that 3978/TCP endpoint then. Won't work with self signed stuff. – evilSnobu Feb 21 '18 at 12:58
  • have valid certificate on 443 port , & tried to run on that port as mentioned in one of the articles , still its giving error when i fire node app.js it give below error Error: listen EADDRINUSE :::80 for 80 port & Error: listen EADDRINUSE :::443 for 443 port , please help – Stack Account Feb 21 '18 at 13:11
  • You have provided zero information about your hosting environment, not sure what you expect from us. The error message is pretty clear, there's another web server running on that machine/instance/whatever-that-is – evilSnobu Feb 21 '18 at 13:23
  • i have hosted my bot on aws server having valid SSL certification & i've installed node & bot framework on same server, what other information you need, Please tell me – Stack Account Feb 21 '18 at 13:28
  • Look at your `server.listen(..)`, that's a plain HTTP listener and there's no TLS. You are probably using something else to listen on 80 and 443/TCP, thus the EADDRINUSE error. Reverse proxy to your Node process if that's the intended setup. – evilSnobu Feb 21 '18 at 13:42
  • 1
    Possible duplicate of [Bot Framework without Azure possible?](https://stackoverflow.com/questions/40888489/bot-framework-without-azure-possible) – Ezequiel Jadib Feb 21 '18 at 16:35

1 Answers1

1

Not familiar with AWS, but for making restify server support HTTPS, you can try to use:

const restify = require('restify');
const fs = require('fs');

const https_options = {
    key: fs.readFileSync('./localhost_3978.key'), //on current folder
    certificate: fs.readFileSync('./localhost_3978.cert')
};

server = restify.createServer(https_options);

Create the restify server with your SSL certificate and key files before your bot application.

Gary Liu
  • 13,758
  • 1
  • 17
  • 32