Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 46664 invoked from network); 5 Jul 2009 22:05:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Jul 2009 22:05:52 -0000 Received: (qmail 64738 invoked by uid 500); 5 Jul 2009 22:06:02 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 64643 invoked by uid 500); 5 Jul 2009 22:06:01 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 64633 invoked by uid 99); 5 Jul 2009 22:06:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Jul 2009 22:06:01 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jchris@gmail.com designates 209.85.212.200 as permitted sender) Received: from [209.85.212.200] (HELO mail-vw0-f200.google.com) (209.85.212.200) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Jul 2009 22:05:51 +0000 Received: by vwj38 with SMTP id 38so2903261vwj.13 for ; Sun, 05 Jul 2009 15:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=bwIAWl1idY6N2joF9oXzti/KpLxiNGcUCxbeiqO+0gU=; b=XhSPO7iaIM5x//Wo06VzTZa8oUE2j5P8qZ2FZeebFTJyyAPSTXb2B0ASgClAZpGJWR HRavRHpHF2Vb+fEH+VAf6ADotKiw7wJUMvyiy0xrTL6l8/fVdDgaIQWV4Ks6VlGdBVGB hA1nAuXbIWJKyKDyzmHb1ZwW9XYezTb+NYxtw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=NrL3oT95chhmy3AmOijGRYTuT2qOUvwTj0xc3BFXHHbBLgDJ0Ex0iYQ+sL74f8beHR vmG/eg4yegJ4JZuULgsZdSzGGm53B+16RieVMft7lMqQnSVTfU+b2XrtTB4hAspSGl/Y EoSTOd240XoFLn+nMmK/WvjTRkeS4WQU968BY= MIME-Version: 1.0 Sender: jchris@gmail.com Received: by 10.220.76.68 with SMTP id b4mr8004970vck.26.1246831529269; Sun, 05 Jul 2009 15:05:29 -0700 (PDT) In-Reply-To: References: Date: Sun, 5 Jul 2009 15:05:29 -0700 X-Google-Sender-Auth: 41b0b8f401b36848 Message-ID: Subject: Re: proxy handler From: Chris Anderson To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Sun, Jul 5, 2009 at 11:49 AM, Benoit Chesneau wrote= : > 2009/7/5 Chris Anderson : > >> This looks really cool. Can you give more examples of it at work? I'm >> not sure I total understand. Looks powerful. >> > > > Main use for this is is proxying remote http services like an XMPP > bosh connection, or any ajax service that don't do JSONP. Obviously > couchapps will have some usage for this. Indeed, with this proxy, you > could aggregate different services on your pages and use them without > worrying about cross-domain problem. > > All you have to proxy a service is to set a local path and destination > path like this : > > [httpd_global_handlers] > _couchdb =3D {couch_httpd_proxy_handler, handle_proxy_req, > <<"http://couchdb.apache.org">>} > _friendpaste =3D {couch_httpd_proxy_handler, handle_proxy_req, > <<"http://friendpaste.com">>} > > > and now you could do use friendpaste api from your application. (which > won't be needed soon, but that's another story). > > > Right now the request body isn't streamed and I would like to have a > way to send it whil receiving it. Maybe it's not possible but I failed > for now to understand how mochiweb api works with it. > I've heard you can just connect the raw sockets together and it works... not sure how that would look in practice. > Hope it's more understandable now :) > > - beno=EEt > --=20 Chris Anderson http://jchrisa.net http://couch.io