First the specs, I have:
Drupal 7.8-dev
connect 0.5.10
express 1.0.7
socket.io 0.7.9

and have tried with 7.x-1.0-beta3, 7.x-1.x-dev, and the most recent git checkout of the nodejs project.

When I run node server.js all appears well, and I get the response:

Started http server.
   info  - socket.io started

The nodejs integration, config, notifications, and actions modules are all enabled, however I can't seem to get notifications to appear.

I think this may be a setup issue on my part. When I first enable the module I get a javascript error:

io is not defined nodejs.js line 60
Drupal.Nodejs.socket = io.connect(ur...pal.settings.nodejs.connectTimeout}); 

Looking at what's spit out in the dom, I see that the filepath is incorrect for socket.io.js which seems to stem from the config. I've changed the config file to reference my host (a virtual host of my localhost) but the path is always incorrect. So I replace line 166 in nodejs.module

<?php
    $socket_io_config['path'] = $nodejs_config['scheme'] . '://' . $nodejs_config['host'] . ':'
                              . $nodejs_config['port'] . $nodejs_config['resource'] . '/socket.io.js';
?>

with a direct path

<?php
    $socket_io_config['path'] = 'http://myhost.dev/sites/all/modules/nodejs/socket_io/socket.io/node_modules/socket.io-client/dist/socket.io.js';
?>

the error goes away, but still no notifications.

I have tried sending messages both from drush and from the admin ui.
I thought there may be an issue with jGrowl, but this doesn't seem to be the case.

I get no other errors from nodejs, drupal, or javascript so am at a bit of a loss.

I'm continuing to try, and may attempt older versions where people claim to have it working. I know a recent update included support for socket.io 0.7+ so kinda wondering if this may be a bug from that.

Any insight here would be greatly appreciated.

Comments

dabblela’s picture

I had a similar issue. With devel module installed, DPM the $socket_io_config variable - I had some http's in my nodejs module settings where there shouldn't have been any.

rho_’s picture

Status: Active » Closed (works as designed)

Got it working.

Seems like a fair amount has changed since DC London. I tried this again with a fresh install of Drupal, and the beta-4 version of node.js module. However I don't think this resolved the initial issue. For anyone who is curious I think it boiled down to my version of node. I paid careful attention to the versions I was using of express, connect and socket.io however kind of blindly installed node. Turns out I was working with v0.5.x of node, after switching to v0.4.x all is well.

bigsyke’s picture

Is that all you did to get it working? Can you give me version numbers I am having the same problems.

Edit: all version numbers produce the same results. Must be something else. Very curious how to setup this new version of nodejs, since the documentation is very unclear if your installing it on a different server. The old version you copied the socket.io folder to the nodejs module folder....do we still do that?