Skip to content

mnylen/websocket-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What?

A very simple web chat that uses WebSockets on the client side and Ruby EventMachine (with em-websocket) at the server side.

Features

  • Automatic scrolling of chat log
  • Automatic refocus on message input after the previous message have been sent

Usage

  1. clone the repo
  2. Install the bundler gem if you haven’t already: gem install bundler
  3. Install dependencies using bundler: bundle install
  4. Start the server: $ cd server; ruby server.rb
  5. Fire up few browser instances and point them to /[path you cloned it to]/client/chat.html
  6. Write your nickname and click Join chat.
  7. After you’ve joined, feel free to send messages by pressing Send
  8. Any messages you send should appear on other browsers you have started

Runs the server on localhost on port 8080. The client is hardcoded to connect to that server and port. If you want to modify these, you need to modify the source.

Future improvements

  • Allow specifying the host and the port the server should run on
  • Allow specifying the host and the port the client should connect to
  • Allow registering nicknames and displaying a list of already registered nicknames
  • Show message after user enters or parts the chat

About

A (very) simple multi-user web chat created with WebSockets and EventMachine on the server side

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published