简体   繁体   English

使用Dialogflow在Google App上的主机操作在自托管HTTPS服务器上使用节点JS(MalformedResponse:Webhook错误(206))

[英]Host Actions On Google App With Dialogflow Using Node JS on Self Hosted HTTPS Server (MalformedResponse: Webhook error (206))

I have created one app in actions on google with dialogflow using nodejs. 我使用nodejs在google上使用dialogflow创建了一个应用程序。 First it is hosted on heroku server, but now i want to host in my server with https. 首先它托管在heroku服务器上,但现在我想用https在我的服务器上托管。

it works properly on heroku server but not working on my server. 它在heroku服务器上正常工作但不能在我的服务器上运行。 It returns error "MalformedResponse: Webhook error (206)" 它返回错误“MalformedResponse:Webhook error(206)”

const express = require('express');
const bodyParser = require('body-parser');
var https = require('https');
var fs = require('fs');
const {
  dialogflow,
} = require('actions-on-google');

const app = dialogflow();
const expressApp = express().use(bodyParser.json());

// degault welcome intent on startup
app.intent('Default Welcome Intent', conv => {  
    conv.ask('Hi, Ask me about Customer Ledger, Outstanding....');
});

app.intent('Default Fallback Intent', conv => {
  conv.ask('I didnt understand. Can you tell me something else?');
});


var options = {
  key: fs.readFileSync('ssl/office.key'),
  cert: fs.readFileSync('ssl/office.crt')
};

var server = https.createServer(options, expressApp).listen(3000, function(){
    //express().use(bodyParser.json(), app);
    expressApp.post('/fulfillment', app);
  console.log("Express server listening on port 3000" );
});

Can anyone suggest me what is the problem with my code? 谁能告诉我我的代码有什么问题? Simulator Screenshot 模拟器截图

如果您正在使用express并且中间没有其他层(如Heroku所有)将请求从端口443转发到3000,则请求可能无法到达目标端口

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 cMalformedResponse:Webhook错误(206)同时看似有效的Webhook响应-Node.js中对Google Dialogflow应用的操作 - cMalformedResponse: Webhook error (206) whilst a seemingly valid webhook response - Actions on Google Dialogflow app in Node.js 用于Webhook的Node.JS https服务器出现握手错误 - Node.JS https server for Webhook gets handshake error 使用 Google 上的操作 SDK 获取 Dialogflow webhook 路径参数 - Getting Dialogflow webhook path parameters using Actions On Google SDK Dialogflow webhook(Google上的操作)。 是否应该使用RichResponse? - Dialogflow webhook (Actions on Google). Should I be using RichResponse or not? 如何使用对话流实现 node.js 在谷歌操作上实现二叉决策树? - How to implement a binary decision tree on google actions using dialogflow fulfillment node.js? Dialogflow/Google Actions 实现(使用 Google App Engine 和存储)返回错误 4:DEADLINE EXCEEDED,尽管很简单 - Dialogflow/Google Actions fulfillment (using Google App Engine & Storage) returning error 4: DEADLINE EXCEEDED, despite being simple 在dialogflow的WebhookClient中使用Google上的轮播或列表操作时出错 - Error using actions-on-google Carousel or List with dialogflow's WebhookClient Android Studio:如何将HTTPS请求发送到使用自签名证书的Node.js服务器? - Android Studio: How to send HTTPS requests to Node.js Server which is using self-signed certificate? 无法从 node.js 上托管的网站向 Google Dialogflow 发送多条消息 - Unable to send more than one message to Google Dialogflow from a website hosted on node.js 将Node Parse API用于自托管的Parse Server - Using Node Parse API for self-hosted Parse Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM