No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Tamas Piros
Tamas Piros Update README.md
Latest commit 8ff534b Dec 4, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.openshift Creating template Jan 21, 2014
node_modules Creating template Jan 21, 2014
public Add timestamp to messages Mar 17, 2015
.bowerrc updates Oct 26, 2013
.gitignore update Oct 26, 2013
README.md Update README.md Dec 4, 2017
bower.json corrected jquery Apr 25, 2014
license.md Create license.md Jun 25, 2015
npm-shrinkwrap.json Add npid package and shrinkwrap Mar 21, 2015
package.json Update package.json Jun 15, 2015
room.js Small syntax cleanups. Apr 3, 2015
server.js Update server.js Jun 15, 2015

README.md

Chat app written in node.js and socket.io

Libraries used

  • node.js / npm
  • socket.io
  • express
  • node-uuid
  • underscore
  • ejs

Functionality

  • People are able to join the chat server after entering their names
  • Usernames are unique - if a username is taken, a new suggestion is generated
  • User agent and geo location are both detected
  • People can setup a room. Room names are unique. One person can create on room and join one room
  • Users have to join a room to chat, except for the whisper feature.
  • Whisper messages are private messages sent between two users
  • With a WebSpeech enabled browsers, users can record their messages
  • Users can leave a room and/or disconnect from the server anytime
  • New: People joining the room will see the past 10 messages (chat history).
  • New: People will see an 'is typing' message when someone is typing a message.

Setup and configuration

Make sure that you update server.js:

server.listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});

and add your own IP address/hostname if required, i.e.:

server.listen(app.get('port'), "192.168.56.102", function(){
  console.log('Express server listening on port ' + app.get('port'));
});

(the port is defined in the app.set('port', process.env.PORT || 3000); section.)

Please also update public/js/client.js:

var socket = io.connect("192.168.56.102:3000");

with the right IP address/hostname.

To install npm install && bower install and to launch run npm start.

Whisper

To send a 'private' message, use the following format in the chat message input box: w:USERNAME:MESSAGE (where 'USERNAME' is the exact name of the user who you wish to whisper to (case-sensitive). For your convenience you can use the whipser link next to the person's username on the left hand side.)

New up to date post: http://tamas.io/further-additions-to-the-node-jssocket-io-chat-app/

Previous articles related to this topic:

Learn the latest on web development

https://fullstack-developer.academy