几天来,我们尝试将 drupal 与 node.js 集成。但我们无法连接到 socket.io.js ..
我们从 chrome 控制台收到此错误消息;
XMLHttpRequest 无法加载http://mydomainname.com:8080/socket.io/1/?t=1340201859161。来源http://mydomainname.comAccess-Control-Allow-Origin 不允许
我们的后端设置是;
/**
* 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
有什么建议吗,谢谢。。