到达drupal 7中的Node.js服务器时出错

我已经在共享主机上安装了node.js服务器。我有一个使用node.js集成模块连接到node.js服务器的drupal站点。 但是每当我试图从pipe理面板广播消息,我得到这个错误消息“错误到达Node.js服务器”错误到达Node.js服务器在“nodejs /发布”与{“data”:{“somecustomdata” :“http://www.google.ca”},“channel”:“nodejs_user_1”,“callback”:“myowncallback”,“clientSocketId”:“”}“%{”data“:{”somecustomdata“:” http://www.google.ca“},”channel“:”nodejs_user_1“,”callback“:”myowncallback“,”clientSocketId“:”“}”:[404] Not Found。“in db log。

任何帮助,将不胜感激。

这很可能是以下两件事之一:

  1. Drupal服务器访问错误的URI。
  2. Node.js服务器没有监听你期望的URI。

当然,不太明显的事情可能会导致错误,但请在继续之前validation这两个错误。

最好的办法是让你的Drupal服务器在错误日志中打印它试图访问的URI,并手动validation你可以在浏览器或其他工具中访问它。

感谢“alandrev”的帮助。我已经在同一天解决了这个问题,但我忘了添加我的错误。其实我没有正确configurationnodejs。我在nodejs.config.js的后端设置上使用了不正确的端口号file.The正确的设置如下所述:

backendSettings = { "scheme":"https", "host":"yourhostname", "port":"port number which is not already in use", 'sslKeyPath': 'key file path for ssl enabled site otherwise leave empty', 'sslCertPath': 'certificate path for ssl enabled site otherwise leave empty', 'sslCAPath': '', "resource":"/socket.io", "baseAuthPath": '/nodejs/', "publishUrl":"publish", "serviceKey":"", "backend":{ "port":443, "scheme": 'https or http', "host":"yourhostname", "messagePath":"/nodejs/message/"}, "clientsCanWriteToChannels":false, "clientsCanWriteToClients":false, "extensions":"", "debug":false, "addUserToChannelUrl": 'user/channel/add/:channel/:uid', "publishMessageToContentChannelUrl": 'content/token/message', "jsMinification":true, "jsEtag":true, "logLevel":1}; 

通过在交通工具上添加“轮询”解决了同样的问题

 backendSettings = { "scheme":"http", "host":"localhost", "port":8081, "key":"/path/to/key/file", "cert":"/path/to/cert/file", "resource":"/socket.io", "publishUrl":"publish", "serviceKey":"SERVICE KEY", "backend":{ "port":80, "host":"localhost", "messagePath":"/mysite/nodejs/message/"}, "clientsCanWriteToChannels":true, "clientsCanWriteToClients":true, "extensions":"", "debug":true, "transports":["websocket","polling", "flashsocket", "htmlfile", "xhr-polling", "jsonp-polling"], "jsMinification":true, "jsEtag":true, "logLevel":1};