Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.

Announcement

#1 2014-11-25 08:17:35

xalupeao
Member
Registered: 2014-11-25
Posts: 1

checkchatstatus and syncuser request AJAX with nodejshelper?

Hi guys.

I have a question. mi LHC is install with nodejshelper, this extension have activated use_publish_notifications in nodejshelper_config.tpl.php

[== PHP ==]
<?php
	$nodeJsHelperSettings = array (
		'prefix' => 'https://',
		'host' => 'xxxxx',
		'port' => ':81',
		'secure' => true,
		'use_cdn' => true,	// Should we use google provided socket.io.js library?, if you are using older version set it to false
		'use_publish_notifications' => true,
		'redis' => array (
					'scheme' => 'tcp',
					'host'   => '127.0.0.1',
					'port'   => 6379,
		),
		'instance_id' => 0, // Set erLhcoreClassInstance::getInstance()->id for automated hosting extension support
	);
?>

And use_publish_notifications in settings.js is true

[== JavaScript ==]
var settings = {}

/**
 * Should we use publish notifications?
 * Redis have to be running on 127.0.0.1 and 6379 port.
 * Set false to disable
 * */
settings.use_publish_notifications = true;

// If you will be using only web application set this to true, will save some resource
settings.ignore_desktop_client = false;
settings.redis = {};
settings.redis.port = 6379;
settings.redis.host = '127.0.0.1';
settings.redis.options =  {};

But my client generate AJAX request to get checkchatstatus and syncuser.

1416903519_captura_de_pantalla_2014-11-25_05.07.21.jpg

Is normal?

Thanks.

Last edited by xalupeao (2014-11-25 08:20:05)

Offline

#2 2014-11-25 10:43:31

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: checkchatstatus and syncuser request AJAX with nodejshelper?

For check status request it's normal before chat is accepted by operator.
As for sync user, these should be gone as soon chat is accepted by operator.
Also chat fallbacks to default ajax request if it fails to connect to NodeJs.

Offline

#3 2016-01-29 11:38:24

dmitry_stas
Member
Registered: 2016-01-29
Posts: 3

Re: checkchatstatus and syncuser request AJAX with nodejshelper?

Hello.

I have the same problem.

I installed NodeJs and Redis, so installed npm socket.io, npm redis. After that I configured settings.js

var settings = {}

/**
 * Should we use publish notifications?
 * Redis have to be running on 127.0.0.1 and 6379 port.
 * Set false to disable
 * */
settings.use_publish_notifications = true;

// If you will be using only web application set this to true, will save some resource
settings.ignore_desktop_client = false;
settings.redis = {};
settings.redis.port = 6379;
settings.redis.host = '127.0.0.1';
settings.redis.options =  {};

settings.web = {};
settings.debug = {};

/**
 * Set path where socket.io is located, it can be also just socket.io
 * */
settings.socketiopath = '/usr/local/lib/node_modules/socket.io';

/**
 * Set your settings
 * */
settings.web.host = "XXX.XXX.XXX.XXX"; //My real IP
settings.web.port = 31129;

/**
 * Enable debug output
 * */
settings.debug.output = true;

module.exports = settings;

and nodejshelper_config.tpl.php

<?php 
	$nodeJsHelperSettings = array (
		'prefix' => 'http://',
		'host' => 'livechat.site.com', // My real hostname
		'port' => ':31129',
	    'path' => '',
		'secure' => false,
		'use_cdn' => true,	// Should we use google provided socket.io.js library?, if you are using older version set it to false
	    'use_local_socket_io_js' => false, // Load socket.io.js file from local filesystem. If use_cdn and use_local_socket_io_js will be false, system will try to load socket.io.js file from node server
		'use_publish_notifications' => true,
		'redis' => array (
					'scheme' => 'tcp',
					'host'   => '127.0.0.1',
					'port'   => 6379,
		),
		'instance_id' => 0, // Set erLhcoreClassInstance::getInstance()->id for automated hosting extension support
	);
?>

and added nodejshelper as extension to settings.ini.php

      'extensions' => 
      array (
	    0 => 'nodejshelper',
      ),

After I try to run server.js

# nodejs server.js

In console I see

nodejs server.js
LHC Server listening on XXX.XXX.XXX.XXX:31129
Debug enabled - true

And nothing else... I don't see new messages in console when I write to chat. I see many GET AJAX Request from browser (like on screenshot in post #1). What I do wrong? May be I need to configure something in Chat Admin Panel?

Last edited by dmitry_stas (2016-01-29 11:39:17)

Offline

#4 2016-01-29 18:49:58

dmitry_stas
Member
Registered: 2016-01-29
Posts: 3

Re: checkchatstatus and syncuser request AJAX with nodejshelper?

OMG... I'm an idiot sad I thought that "server extensions folder" = "root folder". And only after I looked at the php code and saw

$callbackFile = $instance->SiteDir . '/extension/' . $ext . '/callbacks/close_chat.php';

I got it smile After moving 'nodejshelper' folder into 'extension' folder it worked fine

Last edited by dmitry_stas (2016-01-29 18:52:12)

Offline

#5 2016-02-02 12:48:13

PeopleInside
Administrator
From: Italy
Registered: 2014-04-10
Posts: 4,046
Website

Re: checkchatstatus and syncuser request AJAX with nodejshelper?

dmitry_stas thank you for your report and feedback!


lol PeopleInside - Live helper chat - free limited forum support!
wink For commercial support or GitHub [see FAQ here]
ops If you want to support this open source project, just donate [see support page]
glasses Something wrong with the forum? [contact a superhero]

Offline

Board footer