Skip to content

timcubb/nodechat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I found some overly complicated examples of chat servers using NodeJs so I set out to create a simple example.

The client connects and waits for a response.  

The server preserves a list of connected clients in the responses[] array.

Once the server has satisfied one request, the response element is deleted for that client.  So the server's only state
information is a list of clients who are currently expecting a response and that list is completely destructed 
every time a message is broadcast.

Subsequently the client receives the message and reconnects.  So, from the clients perspective
there is always one outstanding ajax request.  If a client drops, his connection will be automatically
purged from the list on the next iteration.

-Rex

To Run:

from the install directory: node nodechatserver.js

then browse to: localhost:8080/nodechat.html

About

Simple Chat client and server using NodeJS and JQuery

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published