Realtime chat using NodeJS and WebSocket
Demo at https://sky.rebugged.com/ (Running version 0.4.3)
(Demo shown at the above link might not reflect the latest changes in code)
- WebSocket API (for establishing and maintaining socket connection with the server)
- NodeJS (acts as server and provides evented request handling)
- websocket module for NodeJS (provides support for WebSocket protocol in server.
- Apache (for serving static content)
- Node.js (Server side)
- websocket module for node (Server side)
- Apache web server to serve static contents (Server side)
- A websocket compliant browser (Client side)
How to use
- Install all the dependencies listed above (NodeJS, Websocket module, Apache server and a compliant browser)
- Clone/copy the Springle-Chat repsitory to a directory inside Apache's web root.
var server_urlto your server URL (probably
localhost). Leave the ports as is.
var enable_sslvalue to
js/server.js, add your server URL (eg:
- Open terminal and CD to the directory where Springle-Chat source code is extracted/cloned.
- Start chat server by typing
- Doing the above step will start the chat server, which will listen for incoming client connections.
- Browse to the source directory in your browser. (eg: http://localhost/Springle-Chat/) and you will get the chat login page.
- Login to chat giving any nickname and chat room name. Thats all!
To enable SSL
- Set the path to your SSL cert and key file in array
var enable_sslvalue to
- Start chat server with ssl option as
node js/server.js --enable-ssl
- Open chat login page in browser also over HTTPS. (eg: https://localhost/Springle-Chat/)
- Thats all!
- Changes you make to the source files will not reflext in the chat front end. To effet the changes, you need to clear the 'HTML5 App Cache' in the browser. (Not normal cache, so
- If chat is not connecting, open
Netpanel in Firebug and check what the error message shown there is.
###v0.4.3 New features
- Added facility to detect when connection is closed and ability to automatically reconnect. (#14)
###v0.4.2.1 Bug fix
- Now desktop notification code is invoked only after browser support for it is checked.
###v0.4.2 New features
- Direct links to chatrooms
- Desktop notifications for new messages (when chat window not in focus). (#16)
###v0.4.1 New features
- SSL support for Websocket communication
###v0.4 New Features
- Added facility to create and join chat rooms (#5)
- Some improvisions in fonts used.
###v0.3 New Features
- Prevent users from sending empty messages (#10)
- Do not strip away newline characters from messages (#12)
###v0.2 New Features
- New and improved UI.
- 'User is typing...' status message (Ticket #1)
- Show flashing title bar when there is new activity in the chat page. (#2)
- Bug fix: HTML tags in user input are stripped prior to rendering. (#3)
- Link to clear chat history.
- Basic functional system with multi-user chat
Source code is released under GNU Affero General Public License v3. See included file
license.txt for details.