diff options
author | Paul Joseph Davis <davisp@apache.org> | 2010-11-05 23:26:21 +0000 |
---|---|---|
committer | Paul Joseph Davis <davisp@apache.org> | 2010-11-05 23:26:21 +0000 |
commit | 11469d902b15145d361f9f7ec66a09ac3d04757c (patch) | |
tree | 3a75d566b2cc55173fa041b6b61ac61fa8c89e41 /test/etap/180-http-proxy.ini | |
parent | c8785113522b8486fab0ba53f2043d94e9b1507f (diff) |
HTTP proxy handler.
The second of two new features to replace the _externals protocols. This
allows users to configure CouchDB to proxy requests to an external HTTP
server. The external HTTP server is not required to be on the same host
running CouchDB.
The configuration looks like such:
[httpd_global_handlers]
_google = {couch_httpd_proxy, handle_proxy_req, <<"http://www.google.com">>}
You can then hit this proxy at the url:
http://127.0.0.1:5984/_google
If you add any path after the proxy name, or make a request with a query
string, those will be appended to the URL specified in the configuration.
Ie:
http://127.0.0.1:5984/_google/search?q=plankton
would translate to:
http://www.google.com/search?q=plankton
Obviously, request bodies are handled as expected.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1031877 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/etap/180-http-proxy.ini')
-rw-r--r-- | test/etap/180-http-proxy.ini | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/etap/180-http-proxy.ini b/test/etap/180-http-proxy.ini new file mode 100644 index 00000000..72a63f66 --- /dev/null +++ b/test/etap/180-http-proxy.ini @@ -0,0 +1,20 @@ +; Licensed to the Apache Software Foundation (ASF) under one +; or more contributor license agreements. See the NOTICE file +; distributed with this work for additional information +; regarding copyright ownership. The ASF licenses this file +; to you under the Apache License, Version 2.0 (the +; "License"); you may not use this file except in compliance +; with the License. You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, +; software distributed under the License is distributed on an +; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +; KIND, either express or implied. See the License for the +; specific language governing permissions and limitations +; under the License. + +[httpd_global_handlers] +_test = {couch_httpd_proxy, handle_proxy_req, <<"http://127.0.0.1:5985/">>} +_error = {couch_httpd_proxy, handle_proxy_req, <<"http://127.0.0.1:5986/">>}
\ No newline at end of file |