我們試圖將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 –