couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Dühr <tobiasdu...@googlemail.com>
Subject Re: Websocket-Server?
Date Tue, 23 Feb 2010 11:04:53 GMT
Sorry for the confusion. I'll try to explain.
Here is a small js-snipped, mocking up the client part

if ("WebSocket" in window) {
  var ws = new WebSocket("ws://mycouchhost.com/");
  ws.onopen = function() {
    ws.send("mydatabase/mydocument/"); // just a (dumb) example! One
would use wrapper functions or json
  };
  ws.onmessage = function (evt) { var received = evt.data; // reply is
a json-object };
  ws.onclose = function() { // websocket is closed. };
} else {
  // the browser doesn't support WebSocket.
}

So actually I want all the functionality of couchdb, not just for
http, but also for websockets.

WebSockets have much less overhead than http once the handshake has
been made and they provide server-push functionality. So I think it
could be nice to use them natively in couch.


2010/2/23 Jon Gretar Borgthorsson <jon.borgthorsson@gmail.com>
>
> I'm a bit confused.
> What would you like to have in the websocket interface? The _changes feed?
>
> --
> Jón Grétar Borgþórsson
>
> On Tue, Feb 23, 2010 at 8:46 AM, Tobias Dühr <tobiasduehr@googlemail.com>wrote:
>
> > Hi all,
> >
> > I've wondered if there are any plans to provide a websocket-server within
> > couchdb in the future? One option to use this right now would be to have an
> > ws-server (e.g.: node.js with websocket [
> > http://devthought.com/blog/2009/12/nodejs-and-the-websocket-protocol/] )
> > to
> > translate ws to http and back.
> > It would be great if couch could handle ws all by itself.
> >
> > cheers,
> > tobi
> >

Mime
View raw message