sunshowers.git  about / heads / tags
Web Sockets for Rack+Rainbows!
$ git log --pretty=format:'%h %s (%cs)%d'
45b4bd3 update README (2011-01-20)
	(HEAD -> master)
3dfbffe add Sinatra 0.9.4 example (2010-01-02)
8005f75 README: no need for disclaimer (2009-12-25)
4838ac0 update README with Zbatery information (2009-12-22)
34223ec README: use write_utf8 in the example (2009-12-22)
f189db6 various README updates (2009-12-22)
43c9c8c GNUmakefile: push tgz instead of the gem, twice (2009-12-21)
eae94de examples/echo_client: do not write binary by default (2009-12-16)
b238af1 Sunshowers 0.2.0 (2009-12-14)
	(tag: v0.2.0)
70badb4 more RDoc (2009-12-14)
...

$ git cat-file blob HEAD:README
= Sunshowers: Web Sockets for Ruby, Rack+Rainbows!

This project is currently unmaintained.  We will pick it up again when the
WebSockets protocol is stable, finalized and implemented on major browsers.
Otherwise don't waste your time.

Sunshowers is a Ruby library for Web Sockets.  It exposes an easy-to-use
API that may be used in both clients and servers.  On the server side,
it is designed to work with Rack::Request and Rainbows! (<= 3.0.0) concurrency
models that expose a synchronous application flow.  On the client side,
it may be used as a standalone wrapper for IO-like objects.

== Features

* supports reads and writes of both UTF-8 and binary Web Socket frames

* compatible with Revactor, Rainbows::Fiber::IO and core Ruby IO objects

* pure Ruby implementation, should be highly portable, tested under 1.9

== License

Sunshowers is copyright 2009 by all contributors (see logs in git).

Sunshowers is 100% Free Software and licensed under the same terms
as Ruby (GPL2 + Ruby License).  See the LICENSE file for more
details.

== Install

You may download the tarball from the Rainbows! project page on Rubyforge
and run setup.rb after unpacking it:

http://rubyforge.org/frs/?group_id=8977

You may also install it via RubyGems on Gemcutter:

  gem install sunshowers

== Usage

Make sure you're using the
{Rainbows!}[http://rainbows.rubyforge.org/] (or
{Zbatery}[http://zbatery.bogomip.org/]) web server with one of the
following concurrency models:

* FiberSpawn
* FiberPool
* Revactor
* ThreadSpawn
* ThreadPool
* RevFiberSpawn

    # A simple echo server example
    require "sunshowers"
    use Rack::ContentLength
    use Rack::ContentType
    run lambda { |env|
      req = Sunshowers::Request.new(env)
      if req.ws?
        req.ws_handshake!
        ws_io = req.ws_io
        ws_io.each do |record|
          ws_io.write_utf8(record)
          break if record == "Goodbye"
        end
        req.ws_quit! # Rainbows! should handle this quietly
      end
      [404, {}, []]
    }

Already using a Rack::Request-derived class?  Sunshowers::WebSocket may
also be included in any Rack::Request-derived class, so you can just
open it up and include it:

  class Sinatra::Request < Rack::Request
    include Sunshowers::WebSocket
  end

See the examples/ directory in the source tree for a client example.

== Disclaimer

There is NO WARRANTY whatsoever if anything goes wrong, but let us know
and we'll try our best to fix it.

This API is highly unstable and designed on a whim, so it may be
completely replaced.

== Development

  git://git.bogomips.org/sunshowers.git
  git://repo.or.cz/sunshowers.git (mirror)

You may browse the code from the web and download the latest snapshot
tarballs here:

* http://git.bogomips.org/cgit/sunshowers.git (cgit)
* http://repo.or.cz/w/sunshowers.git (gitweb)

Inline patches (from "git format-patch") to the mailing list are
preferred because they allow code review and comments in the reply to
the patch.

We will adhere to mostly the same conventions for patch submissions as
git itself.  See the Documentation/SubmittingPatches document
distributed with git on on patch submission guidelines to follow.  Just
don't email the git mailing list or maintainer with Sunshowers patches.

== Contact

All feedback (bug reports, user/development discussion, patches, pull
requests) go to the mailing list/newsgroup.  Do not send HTML mail,
do not top post.

* mailto:sunshowers@librelist.com

# heads (aka `branches'):
$ git for-each-ref --sort=-creatordate refs/heads \
	--format='%(HEAD) %(refname:short) %(subject) (%(creatordate:short))'
* master       update README (2011-01-20)
  rack.io      support for env["rack.io"] in environment (2009-12-24)

# tags:
$ git for-each-ref --sort=-creatordate refs/tags \
	--format='%(refname:short) %(subject) (%(creatordate:short))'
v0.2.0       Sunshowers 0.2.0 (2009-12-14) tar.gz
v0.1.1       Sunshowers 0.1.1 (2009-12-13) tar.gz
v0.1.0       Sunshowers 0.1.0 (2009-12-13) tar.gz

git clone https://yhbt.net/sunshowers.git