lovelle / jquery-chat

100% Javascript realtime chat like facebook/gmail web style built with jQuery + Node.js + Socket.IO
http://jquery-chat.net/
MIT License
306 stars 132 forks source link

Maximum call stack size exceeded #11

Closed Adnanhmd closed 9 years ago

Adnanhmd commented 9 years ago

Hi

Whenever i click on chat box i get this error after loading is done Error: Uncaught RangeError: Maximum call stack size exceededUrl: http://115.119.117.86:8085/home/Maxx/jquery-chat/js/jquery-1.11.3.min.jsLine: 0

lovelle commented 9 years ago

Hi,

When I go to http://115.119.117.86:8085/home/Maxx/jquery-chat/index.html to check this, the "index.html" file seems to be deleted because server throws 404 error.

Adnanhmd commented 9 years ago

Could please tell me how to install socket.io in my server and i have installed npm already

lovelle commented 9 years ago

Please take a look these instructions here and let me know if you need some help.

Kind regards.

Adnanhmd commented 9 years ago

Hi

I did the following steps $ cd /var/www/jquery-chat/server $ npm install $ npm start Then a folder by name "node_modules" got created inside "server" folder And in my "index.html" file inside"jquery-chat" folder i gave the path " " . And whenever i load the file i get the following error "Uncaught ReferenceError: require is not defined"

This is inside socket.io file (contains) "var client = require('socket.io-client');"

Please visit :- http://115.119.117.86:8085/home/maxx/jquery-chat/index.html

lovelle commented 9 years ago

The error is above line

<script src='http://115.119.117.86:8085/home/Maxx/jquery-chat/server/node_modules/socket.io/lib/socket.io.js'></script>

You are not deploying your own node server, you are calling the "js" socket io script with full path, that configuration will not work, you need to deploy your node instance on a different port from the webserver listening port.

If you can't deploy your own node server you can use the one provided in example index:

<script src='https://jquery-chat.herokuapp.com/socket.io/socket.io.js'></script>
Adnanhmd commented 9 years ago

Hi

Then do i only need to change the config server: '115.119.117.86', port: '8085' ??

http://115.119.117.86:8085/home/maxx/jquery-chat/config.js

lovelle commented 9 years ago

in port 8085 you have listening the webserver, you can't listen two applications in the same port. You must put listen port in node on a different port.

for working purpose set in config.js the next conf:

server: 'jquery-chat.herokuapp.com',
port: '80',

and this in index.

<script src='https://jquery-chat.herokuapp.com/socket.io/socket.io.js'></script>

and then will work because you will connect to a valid node server.

Adnanhmd commented 9 years ago

Hi

I want to personalized this chat application to work only when someone logs into my server. But i tried the procedure you have described but if some people logs here http://jquery-chat.net/ even those people are visible in my chat.

lovelle commented 9 years ago

Yes, because clients are connecting to the same node instance, if you want to have your own instance, you must deploy your own node instance successfully. Before deploying node over internet, try to do in localhost for example in a XAMPP environment or something like that to get understand how it works, or take a look here.

Kind regards.

Adnanhmd commented 9 years ago

Hi

Is there is any other simple step by step procedure to deploy node in XAMPP or WAMP server ?? Means how exactly i need to setup ??

lovelle commented 9 years ago

Sorry I don't know, just was an idea for testing purpose on your own environment. The thing that you are not able to do is deploying successful node instance.

Try to install node js in your localhost configure them to connect with the instruction specified above.