Skip to content

Demonstrates using the EventSource / Server-Sent Events feature of the Firebase REST API to implement a simple commandline chat client in Ruby and Python

License

Notifications You must be signed in to change notification settings

yonirab/EventSource-Examples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventSource-Examples

Demonstrates using the EventSource / Server-Sent Events feature of the Firebase REST API to implement a simple commandline chat client in Ruby and Python.

Each client has the same architecture:

  • A thread listening the Server-Sent Events endpoint from Firebase
  • A thread to POST messages to Firebase
  • A thread to manage the UI
    • Curses UI. Fancy commandline chat
    • Basic UI. Prints messages to stdout

Running the Python example

cd python

pip install -r requirements.txt

python chat.py

Running the Ruby example

cd ruby

bundle install

ruby chat.rb

Use With Your Own Firebase

Simply change the URL constants in chat.py / chat.rb to point to a location in your own Firebase.

Suggestions / bugfixes / implementations in other languages welcome!

About

Demonstrates using the EventSource / Server-Sent Events feature of the Firebase REST API to implement a simple commandline chat client in Ruby and Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 61.5%
  • Python 38.5%