The NodeJS server starts and works as a charm as long as I'm on localhost, and use localhost in my config for NodeJS.

But when I try to move the NodeJS and website to another server I get this in my browser console log:

XMLHttpRequest cannot load http://php55.local:8888/socket.io/?EIO=2&transport=polling&t=1402903467517-45. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://php55.local' is therefore not allowed access. dblog:1
XMLHttpRequest cannot load http://php55.local:8888/socket.io/?EIO=2&transport=polling&t=1402903473518-46. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://php55.local' is therefore not allowed access.

My nodejs.config.js:

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

My config from "admin/config/nodejs/config" screenshot attached.

CommentFileSizeAuthor
#1 Selection_e1bc_001.png71.04 KBtlyngej
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tlyngej’s picture

Issue summary: View changes
FileSize
71.04 KB
tlyngej’s picture

Issue summary: View changes
SocialNicheGuru’s picture

Version: 7.x-1.8 » 7.x-1.x-dev
Component: Miscellaneous » Code
Category: Support request » Bug report

this happened on 7.x-1.8 and the June 17 dev version

javi.pl’s picture

Same problem here, after i downgrade module to 7.x-1.7 problem with "XMLHttpRequest" is gone and i can play again. But it's not a solution at the end.

LeoCR2017’s picture

I fixed the same issue,with a simple Javascript method called Location.replace() ,in my case this error occurs on the DOM not in the backend