Hi all,
I just commited to my couchdb repo a proxy reverse handler. It allow
people to proxy what they need in couchdb by setting destination
patch. I will mostly use it to proxy my local BOSH connection manager
but it also could be used to reverse a complete couchapp or whatever
you want. For example to reverse http://apache.couchdb.org to
/_couchdb add this settings to your local.ini :
[httpd_global_handlers]
_couchdb = {couch_httpd_misc_handlers, handle_proxy_req,
<<"http://couchdb.apache.org">>}
This proxy handle redirection inside destination path root. Ex if you
have /_nymphormation -> http://nymphormation.org and
http://www.nymphormation.org ->
http://www.nymphormation.org/n/_design/nymphormation/_list/links/news?descending=true&limit=11
user will be redirected to
/_nymphormation/n/_design/nymphormation/_list/links/news?descending=true&limit=11
so relative paths would work.
Current limitation :
- local path aren't handle for now in destination path but I'm working on it.
- need more tests
Source is on github :
http://github.com/benoitc/couchdb/tree/proxy_handler
Hope it could be usefull for someone.
- benoƮt