Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 00A7D10496 for ; Thu, 25 Apr 2013 19:58:12 +0000 (UTC) Received: (qmail 89796 invoked by uid 500); 25 Apr 2013 19:58:11 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 89751 invoked by uid 500); 25 Apr 2013 19:58:11 -0000 Mailing-List: contact commits-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 commits@couchdb.apache.org Received: (qmail 89743 invoked by uid 99); 25 Apr 2013 19:58:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 19:58:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 949C388168D; Thu, 25 Apr 2013 19:58:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chewbranca@apache.org To: commits@couchdb.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 86cda7b Date: Thu, 25 Apr 2013 19:58:11 +0000 (UTC) Updated Branches: refs/heads/master a0fc1c608 -> 86cda7b37 Allow external CouchDB servers for Fauxton proxy Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/86cda7b3 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/86cda7b3 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/86cda7b3 Branch: refs/heads/master Commit: 86cda7b37f5d2a8d5cd2a2022333c06d71ffb4de Parents: a0fc1c6 Author: Russell Branca Authored: Thu Apr 25 12:57:49 2013 -0700 Committer: Russell Branca Committed: Thu Apr 25 12:58:05 2013 -0700 ---------------------------------------------------------------------- src/fauxton/Gruntfile.js | 11 ++++++++--- src/fauxton/tasks/couchserver.js | 16 ++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/86cda7b3/src/fauxton/Gruntfile.js ---------------------------------------------------------------------- diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js index 814279a..b76ae24 100644 --- a/src/fauxton/Gruntfile.js +++ b/src/fauxton/Gruntfile.js @@ -194,9 +194,14 @@ module.exports = function(grunt) { dist: './dist/debug/', port: 8000, proxy: { - host: 'localhost', - port: 5984, - https: false + target: { + host: 'localhost', + port: 5984, + https: false + }, + // This sets the Host header in the proxy so that you can use external + // CouchDB instances and not have the Host set to 'localhost' + changeOrigin: true } }, http://git-wip-us.apache.org/repos/asf/couchdb/blob/86cda7b3/src/fauxton/tasks/couchserver.js ---------------------------------------------------------------------- diff --git a/src/fauxton/tasks/couchserver.js b/src/fauxton/tasks/couchserver.js index a3f620f..576893b 100644 --- a/src/fauxton/tasks/couchserver.js +++ b/src/fauxton/tasks/couchserver.js @@ -26,11 +26,13 @@ module.exports = function (grunt) { var port = options.port || 8000; // Proxy options with default localhost - var proxy_target = options.proxy || { - host: 'localhost', - port: 5984, - https: false - }; + var proxy_settings = options.proxy || { + target: { + host: 'localhost', + port: 5984, + https: false + } + }; // inform grunt that this task is async var done = this.async(); @@ -46,9 +48,7 @@ module.exports = function (grunt) { }); // create proxy to couch for all couch requests - var proxy = new httpProxy.HttpProxy({ - target: proxy_target - }); + var proxy = new httpProxy.HttpProxy(proxy_settings); app.all('*', function (req, res) { proxy.proxyRequest(req, res);