我们试图将drupal与node.js集成几天。但我们无法连接到socket.io.js ..drupal - node.js集成
我们从chrome控制台收到此错误消息;
XMLHttpRequest无法加载http://mydomainname.com:8080/socket.io/1/?t=1340201859161。 Access-Control-Allow-Origin不允许原产地http://mydomainname.com。
和我们的后端设置是;
/**
* This configuration file was built using the 'Node.js server configuration builder'.
* For a more fully commented example see the file nodejs.config.js.example in the root of this module
*/
backendSettings = {
"scheme":"http",
"host":"mydomainname",
"port":8080,
"key":"/path/to/key/file",
"cert":"/path/to/cert/file",
"resource":"/sites/all/modules/nodejs/node_modules/socket.io/lib",
"publishUrl":"publish",
"serviceKey":"",
"backend":{
"port":80,
"host":"urb5.com",
"messagePath":"realtime"},
"clientsCanWriteToChannels":false,
"clientsCanWriteToClients":false,
"extensions":["nodejs.server.extension.js"],
"debug":true,
"transports":["websocket",
"flashsocket",
"htmlfile",
"xhr-polling",
"jsonp-polling"],
"jsMinification":true,
"jsEtag":true,
"logLevel":1};
而且,在源代码中,我们有一个脚本socket.io脚本, 像
<script type="text/javascript" src="http://mydomainname.com:8080/sites/all/modules/nodejs/node_modules/socket.io/lib/socket.io.js"></script>
此脚本版本号为0.9.6,但如果我们按照这个路径在FTP中,是socket.io.js但它的版本号是0.9.5
什么建议? 感谢..
我认为这是一个重复的:http://stackoverflow.com/questions/6818029/node-js-socket-io-simple-chat –