* [ANN] LMGTWTY: Web Sockets Library for Rack+Rainbows! @ 2009-12-11 11:50 Eric Wong [not found] ` <20091211115041.GA14610-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Eric Wong @ 2009-12-11 11:50 UTC (permalink / raw) To: lmgtwty-TBHja+091Wbby3iVrkZq2A, rainbows-talk-GrnCvJ7WPxnNLxjTenLetw LMGTWTY is a Rainbows! (and Zbatery) Rack library for Web Sockets. It uses unofficial extensions in rainbows.git for Rack which are subject to change, but it appears to work well enough for the echo_client.py example shipped with pywebsocket. It has not been tested against normal web browsers, though there's no reason it shouldn't work. It currently depends on the git version of Rainbows. http://git.bogomips.org/cgit/lmgtwty.git http://git.bogomips.org/cgit/rainbows.git There are no releases yet, just grab from git (install the wonderful "iobuffer" gem, too). The API is subject to change (like Web Sockets itself (I think)). This was done completely on a whim tonight, with no thought or planning beforehand. So I can't say I'm completely happy with the API. At least I believe I finally understand Ruby 1.9 encodings after writing Lmgtwty::IO (having read and reread article after article on it over the past few years)... Mailing list is here: lmgtwty-TBHja+091Wbby3iVrkZq2A@public.gmane.org Just send and email and follow instructions to subscribe. -- Eric Wong _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20091211115041.GA14610-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>]
* Re: [ANN] LMGTWTY: Web Sockets Library for Rack+Rainbows! [not found] ` <20091211115041.GA14610-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> @ 2009-12-11 11:53 ` Eric Wong [not found] ` <20091211115348.GB14610-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> 2009-12-13 20:50 ` [ANN] LMGTWTY: Web Sockets Library for Rack+Rainbows! Eric Wong 1 sibling, 1 reply; 7+ messages in thread From: Eric Wong @ 2009-12-11 11:53 UTC (permalink / raw) To: lmgtwty-TBHja+091Wbby3iVrkZq2A, rainbows-talk-GrnCvJ7WPxnNLxjTenLetw Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org> wrote: > http://git.bogomips.org/cgit/lmgtwty.git > http://git.bogomips.org/cgit/rainbows.git > > There are no releases yet, just grab from git > (install the wonderful "iobuffer" gem, too). One more thing, for both of them, if you have RubyGems 1.3.5, "make install-gem" works (or "make gem" and then manually installing the file). Of course "make install" works too if you're not worried about uninstalling. -- Eric Wong _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20091211115348.GB14610-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>]
* [PATCH] env["hack.io"] for Fiber*, Revactor, Thread* models [not found] ` <20091211115348.GB14610-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> @ 2009-12-11 11:59 ` Eric Wong [not found] ` <20091211115905.GA15621-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Eric Wong @ 2009-12-11 11:59 UTC (permalink / raw) To: lmgtwty-TBHja+091Wbby3iVrkZq2A, rainbows-talk-GrnCvJ7WPxnNLxjTenLetw This exposes a client IO object directly to the underlying application. --- In case you already have an installation and just want to patch that, this is the patch I made for Rainbows! that exposes the ability to be used with LMGTWTY lib/rainbows/base.rb | 1 + lib/rainbows/const.rb | 6 ++++++ lib/rainbows/fiber/base.rb | 1 + lib/rainbows/revactor.rb | 1 + 4 files changed, 9 insertions(+), 0 deletions(-) diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb index 424b43b..a735b82 100644 --- a/lib/rainbows/base.rb +++ b/lib/rainbows/base.rb @@ -43,6 +43,7 @@ module Rainbows buf << client.readpartial(CHUNK_SIZE) end + env[CLIENT_IO] = client env[RACK_INPUT] = 0 == hp.content_length ? HttpRequest::NULL_IO : Unicorn::TeeInput.new(client, env, hp, buf) diff --git a/lib/rainbows/const.rb b/lib/rainbows/const.rb index 69e58aa..900c9d9 100644 --- a/lib/rainbows/const.rb +++ b/lib/rainbows/const.rb @@ -19,5 +19,11 @@ module Rainbows CONN_ALIVE = "Connection: keep-alive\r\n" LOCALHOST = "127.0.0.1" + # client IO object that supports reading and writing directly + # without filtering it through the HTTP chunk parser. + # Maybe we can get this renamed to "rack.io" if it becomes part + # of the official spec, but for now it is "hack.io" + CLIENT_IO = "hack.io".freeze + end end diff --git a/lib/rainbows/fiber/base.rb b/lib/rainbows/fiber/base.rb index 129448c..995b4af 100644 --- a/lib/rainbows/fiber/base.rb +++ b/lib/rainbows/fiber/base.rb @@ -82,6 +82,7 @@ module Rainbows buf << (client.read_timeout or return) end + env[CLIENT_IO] = client env[RACK_INPUT] = 0 == hp.content_length ? HttpRequest::NULL_IO : TeeInput.new(client, env, hp, buf) env[REMOTE_ADDR] = remote_addr diff --git a/lib/rainbows/revactor.rb b/lib/rainbows/revactor.rb index b647d48..ff0e429 100644 --- a/lib/rainbows/revactor.rb +++ b/lib/rainbows/revactor.rb @@ -49,6 +49,7 @@ module Rainbows buf << client.read(*rd_args) end + env[Const::CLIENT_IO] = client env[Const::RACK_INPUT] = 0 == hp.content_length ? HttpRequest::NULL_IO : Rainbows::Revactor::TeeInput.new(client, env, hp, buf) -- Eric Wong _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying ^ permalink raw reply related [flat|nested] 7+ messages in thread
[parent not found: <20091211115905.GA15621-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>]
* Re: [PATCH] env["hack.io"] for Fiber*, Revactor, Thread* models [not found] ` <20091211115905.GA15621-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> @ 2009-12-13 13:47 ` James Tucker [not found] ` <D3B4FD37-50B9-4913-88E3-92C1B1877ED8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: James Tucker @ 2009-12-13 13:47 UTC (permalink / raw) To: Rainbows! list Testing, all my mails to this ML seem to be getting rejected based on content type, seems Mail.app isn't sending plain, when I tell it to, or it doesn't like my S/MIME On 11 Dec 2009, at 11:59, Eric Wong wrote: > This exposes a client IO object directly to the underlying > application. > --- > > In case you already have an installation and just want to patch that, > this is the patch I made for Rainbows! that exposes the ability to > be used with LMGTWTY > > lib/rainbows/base.rb | 1 + > lib/rainbows/const.rb | 6 ++++++ > lib/rainbows/fiber/base.rb | 1 + > lib/rainbows/revactor.rb | 1 + > 4 files changed, 9 insertions(+), 0 deletions(-) > > diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb > index 424b43b..a735b82 100644 > --- a/lib/rainbows/base.rb > +++ b/lib/rainbows/base.rb > @@ -43,6 +43,7 @@ module Rainbows > buf << client.readpartial(CHUNK_SIZE) > end > > + env[CLIENT_IO] = client > env[RACK_INPUT] = 0 == hp.content_length ? > HttpRequest::NULL_IO : > Unicorn::TeeInput.new(client, env, hp, buf) > diff --git a/lib/rainbows/const.rb b/lib/rainbows/const.rb > index 69e58aa..900c9d9 100644 > --- a/lib/rainbows/const.rb > +++ b/lib/rainbows/const.rb > @@ -19,5 +19,11 @@ module Rainbows > CONN_ALIVE = "Connection: keep-alive\r\n" > LOCALHOST = "127.0.0.1" > > + # client IO object that supports reading and writing directly > + # without filtering it through the HTTP chunk parser. > + # Maybe we can get this renamed to "rack.io" if it becomes part > + # of the official spec, but for now it is "hack.io" > + CLIENT_IO = "hack.io".freeze > + > end > end > diff --git a/lib/rainbows/fiber/base.rb b/lib/rainbows/fiber/base.rb > index 129448c..995b4af 100644 > --- a/lib/rainbows/fiber/base.rb > +++ b/lib/rainbows/fiber/base.rb > @@ -82,6 +82,7 @@ module Rainbows > buf << (client.read_timeout or return) > end > > + env[CLIENT_IO] = client > env[RACK_INPUT] = 0 == hp.content_length ? > HttpRequest::NULL_IO : TeeInput.new(client, env, hp, buf) > env[REMOTE_ADDR] = remote_addr > diff --git a/lib/rainbows/revactor.rb b/lib/rainbows/revactor.rb > index b647d48..ff0e429 100644 > --- a/lib/rainbows/revactor.rb > +++ b/lib/rainbows/revactor.rb > @@ -49,6 +49,7 @@ module Rainbows > buf << client.read(*rd_args) > end > > + env[Const::CLIENT_IO] = client > env[Const::RACK_INPUT] = 0 == hp.content_length ? > HttpRequest::NULL_IO : > Rainbows::Revactor::TeeInput.new(client, env, hp, buf) > -- > Eric Wong > _______________________________________________ > Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org > http://rubyforge.org/mailman/listinfo/rainbows-talk > Do not quote signatures (like this one) or top post when replying _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <D3B4FD37-50B9-4913-88E3-92C1B1877ED8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] env["hack.io"] for Fiber*, Revactor, Thread* models [not found] ` <D3B4FD37-50B9-4913-88E3-92C1B1877ED8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2009-12-13 19:45 ` Eric Wong [not found] ` <20091213194553.GC19572-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Eric Wong @ 2009-12-13 19:45 UTC (permalink / raw) To: Rainbows! list James Tucker <jftucker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Testing, all my mails to this ML seem to be getting rejected based on > content type, seems Mail.app isn't sending plain, when I tell it to, > or it doesn't like my S/MIME Hi James, Only text/plain is allowed at the moment. And looking at your S/MIME signatures on rack-devel, they're humongous compared to the size of the message. -- Eric Wong _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20091213194553.GC19572-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>]
* Re: [PATCH] env["hack.io"] for Fiber*, Revactor, Thread* models [not found] ` <20091213194553.GC19572-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> @ 2009-12-13 21:25 ` James Tucker 0 siblings, 0 replies; 7+ messages in thread From: James Tucker @ 2009-12-13 21:25 UTC (permalink / raw) To: Rainbows! list On 13 Dec 2009, at 19:45, Eric Wong wrote: > James Tucker <jftucker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Testing, all my mails to this ML seem to be getting rejected based on >> content type, seems Mail.app isn't sending plain, when I tell it to, >> or it doesn't like my S/MIME > > Hi James, > > Only text/plain is allowed at the moment. I'd forgotten adding S/MIME to a message means it's not text/plain. > And looking at your S/MIME > signatures on rack-devel, they're humongous compared to the size of the > message. Fair call. > > -- > Eric Wong > _______________________________________________ > Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org > http://rubyforge.org/mailman/listinfo/rainbows-talk > Do not quote signatures (like this one) or top post when replying _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ANN] LMGTWTY: Web Sockets Library for Rack+Rainbows! [not found] ` <20091211115041.GA14610-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> 2009-12-11 11:53 ` Eric Wong @ 2009-12-13 20:50 ` Eric Wong 1 sibling, 0 replies; 7+ messages in thread From: Eric Wong @ 2009-12-13 20:50 UTC (permalink / raw) To: lmgtwty-TBHja+091Wbby3iVrkZq2A, rainbows-talk-GrnCvJ7WPxnNLxjTenLetw Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org> wrote: > LMGTWTY is a Rainbows! (and Zbatery) Rack library for Web Sockets. It This name was too hard to remember for most folks, so I'm renaming it to Sunshowers: sunshowers-TBHja+091Wbby3iVrkZq2A@public.gmane.org -- Eric Wong _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-12-13 21:25 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-12-11 11:50 [ANN] LMGTWTY: Web Sockets Library for Rack+Rainbows! Eric Wong [not found] ` <20091211115041.GA14610-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> 2009-12-11 11:53 ` Eric Wong [not found] ` <20091211115348.GB14610-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> 2009-12-11 11:59 ` [PATCH] env["hack.io"] for Fiber*, Revactor, Thread* models Eric Wong [not found] ` <20091211115905.GA15621-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> 2009-12-13 13:47 ` James Tucker [not found] ` <D3B4FD37-50B9-4913-88E3-92C1B1877ED8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2009-12-13 19:45 ` Eric Wong [not found] ` <20091213194553.GC19572-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> 2009-12-13 21:25 ` James Tucker 2009-12-13 20:50 ` [ANN] LMGTWTY: Web Sockets Library for Rack+Rainbows! Eric Wong
Code repositories for project(s) associated with this public inbox https://yhbt.net/rainbows.git/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).