janl commented on issue #1407: Proxy bug in 2.1.1: httpd_global_handlers 
{couch_httpd_proxy, handle_proxy_req,..}
URL: https://github.com/apache/couchdb/issues/1407#issuecomment-406182080
 
 
   I’ve had a detailed look at this, and the reason this wasn't ported (other 
than this feature being on the deprecation path) was that chttpd doesn’t have a 
way to load routes from runtime configuration. The design of `chttpd` also 
makes this an unlikely addition.
   
   What *would be possible* is re-hooking up the old handler in a new way (so 
the feature would be exist again, but it’d be configured differently). E.g. we 
could do a new config section:
   
   ```
   [chttpd_proxy]
   endpoint = "http://example.com";
   ```
   
   The way this would work then is a static URL like `/_proxy/:endpoint` for 
all requests, but you could configure `:endpoint`, but not `_proxy` which you 
could do before.
   
   I believe that would still satisfy the requirements for this feature, 
however:
   
   1. This approach wouldn’t be backwards compatible to 1.x. Since bringing 
this feature back is about restoring that compatibility is the whole point, we 
miss that point.
   
   2. This whole feature is slated to be deprecated for 3.0, so I’m hard 
pressed to add any code that will be relatively short lived and deprecated on 
introduction.
   
   3. I realise it is convenient to just run CouchDB somewhere and have it be 
the sole piece of infrastructure needed, but these days it is very simple to 
spin up a proxy server in front of CouchDB in whatever environment you need 
(haproxy, nginx, [g]unicorn, node.js etc.pp.), so at least there is a 
workaround.
   
   4. Adding a BC-preserving version of this would mean a significant addition 
to `chttpd` that I don’t see anyone adding, or if proposed, willing to maintain.
   
   Therefore, I propose to mark this as a documentation error, we should have 
announced it’s removal on the release of 2.0.0. As we’ve missed this, we should 
follow suit quickly.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to