Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
my installation is not working and io.on('connection') callback in server.js is never being called because (as far as i can tell) drupal module javascript is
io.on('connection', function(socket) {
clientManager.addSocket(socket);
})
.on('error', function(exception) {
console.log('Socket error [' + exception + ']');
});
my node.config.js file
/**
* 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":"localhost",
"port":7001,
"key":"/path/to/key/file",
"cert":"/path/to/cert/file",
"resource":"/socket.io",
"publishUrl":"publish",
"serviceKey":"",
"backend":{
"port":80,
"host":"async1.vs",
"messagePath":"/nodejs/message"},
"clientsCanWriteToChannels":false,
"clientsCanWriteToClients":false,
"extensions":"",
"debug":true,
"transports":["websocket","polling"],
"jsMinification":true,
"jsEtag":true,
"logLevel":1};
i've added some trace messages in. the problem is no socketid's because not being saved in
io.on('connection')
[2017/05/04 19:18:38] Body
{ broadcast: true,
data:
{ subject: 'A user <em class="placeholder">logged in</em>.',
body: 'The user <a href="/user/2">user2</a> <em class="placeholder">logged in</em>.' },
channel: 'nodejs_notify',
clientSocketId: '' }
broadcastMessage:entry
broadcastMessage:exit
[2017/05/04 19:18:38] message broadcast to 0 users
Comments
Comment #2
Syntapse CreditAttribution: Syntapse commentedthis is the best info i have though i logged a more vague issue based on the same problem.
preferred that we move discussion to here and i can close previous issue.
is this module still being actively maintained?
Comment #3
Syntapse CreditAttribution: Syntapse commenteddrupal nodejs integration php module: nodejs.js line 88 is checking io object. where is io defined and why is it silently returning a false. isnt 'undefined' an exception not a silent return?
this appears to explain why the nodejs server has no clientsocket ids.
not sure how its meant to work? is this a global io object with no definition or declaration?
Comment #4
Syntapse CreditAttribution: Syntapse commentedComment #5
Syntapse CreditAttribution: Syntapse commentedwhere is drupal getting its io object from? which socket.io is is referencing?
Comment #6
Syntapse CreditAttribution: Syntapse commentedComment #7
rlmumford@laurencefass which issue is a duplicate of this?
Comment #8
rlmumfordComment #9
Syntapse CreditAttribution: Syntapse commented