Hi,
I am racking my brain over this, and thought it might be worth asking for help.
I have set up the latest version of this module, as well as nodejs and supporting modules as instructed in the README.
node server.js starts with info - socket.io started.
When I access pages on the drupal site and use Chrome's inspect tool, there is an error with socket.io.js because it only shows, "Welcome to socket.io" (which Chrome reads as a syntax error, haha). I also noticed that the inline js beneath socket.io.js is not being populated by anything as, I believe it should in order to tell socket.io what to do. Meanwhile on the Ubuntu server terminal where nodejs is running, I see the error, "unhandled socket.io url."
I have googled this issue a bit, and it suggests changing the version of socket.io, but I think there is something else going on because I think "Welcome to socket.io" is the default message when socket.io is being called, but with no request.
Any thoughts would be helpful. Thanks!
Eric
Comments
Comment #1
Equinger commentedstill stuck. any ideas?
Comment #2
julien commentedWhat is your node version on the server? output of "node -v"
When you download the module, inside its directory, you should do 3 npm install:
npm install connect@1.1.4
npm install express@2.4.3
npm install request
Also you need to configure nodejs.config.js and also the backend settings.
Comment #3
carnau commentedI also faced this error some time ago, it's just a bad url in your backend config file that not points to the correct file.
You can check what values are used, placing this inside a hook_init().
Comment #4
Equinger commentedThat did it. Thank you!
Comment #5
Anonymous (not verified) commentedthanks carnau! closing now, please reopen if this didn't fix it.
Comment #7
fenda commentedSorry for a re-open. I am getting the same issue.
I have a node JS server running and with the following test.js server, I can get the socket.io.js file:
But when running the server.js file (in exactly the same folder as test.js) I can't get the socket.io.js file with the same URL that worked above.
My nodejs.config.js file:
Comment #8
fenda commentedFixed the problem. Not sure if this is a bug or not.
In nodejs.config.js the 'host' must be the actual nodejs hostname if accessed externally. So you cannot use 'localhost' or '127.0.0.1' for that.
Comment #9
Anonymous (not verified) commentedoh, yep, node will resolve the host and bind on that ip.