Skip to content

tapocol/sarb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socket Action Ruby (sarb)

Framework for em-websocket that uses actions and triggers for real-time communication with your app.

Install

For latest rubygems version:

gem "sarb"

For latest github commit:

gem "sarb", :git => "https://github.com/craigjackson/sarb.git"

Example

require "sarb"

app = Sarb::Application.new
app.action(:foo) { |session, args| session.message(:action => :bar) }
app.run

On client side:

var ws = new WebSocket("ws://127.0.0.1:8080/");
ws.onmessage = function(message) { console.log(message) };
ws.send(JSON.stringify({ action: "foo" }))

Linked Examples

License

The MIT License - Copyright (c) 2012-2013 Craig Jackson

About

Socket Action Ruby

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages