jkroon-immt opened a new issue #1080: CouchDB failing to replicate behind a 
proxy server
URL: https://github.com/apache/couchdb/issues/1080
 
 
   ## Expected Behavior
   When replicating from a remote CouchDB database to a CouchDB database on the 
local PC via a proxy, replication should be successful.
   
   ## Current Behavior
   CouchDB is seeing localhost / 127.0.0.1 as an HTTP-based target and assuming 
it needs to use the proxy, this causes replication to fail with CouchDB 
reporting an 'invalid_json' error due to the request via the proxy returning an 
error HTML page.
   
   ## Possible Solution
   A possible quick solution would be to add a check for localhost URLs and not 
use the proxy for those. Alternatively, it may be useful to add a sourceProxy 
and targetProxy, leaving the current proxy setting to behave as is. So the 
logic for getting the source poxy in the code would be to look at sourceProxy 
first, then the current proxy setting. Similarly for the target. The benefit of 
this alternate approach would be that you can proxy localhost if you need to 
(e.g. for local development using Fiddler).
   
   ## Steps to Reproduce (for bugs)
   
   This can be easily reproduced by using a replication document similar to the 
one provided below in the /_replicator/ database.
   
   ```
   {
     "_id": "rep_init",
     "_rev": "20-81f3b1999b7f8e9ac51a45e3acbc4432",
     "source": 
"https://<username>:<password>@dbgateway.<domain>.com/<source_db_name>",
     "target": "http://127.0.0.1:5984/<target_db_name>",
     "create_target": false,
     "continuous": false,
     "filter": "replication_filter/no_ddocs",
     "owner": null,
     "proxy": "http://<proxy_ip_address>:<proxy_port>",
     "_replication_state": "error",
     "_replication_state_time": "2017-12-07T15:59:12+08:00",
     "_replication_state_reason": "{invalid_json,{error,{1,invalid_json}}}",
     "_replication_id": "d449aac07eeb8da0e322d4646e0b0f9a"
   }
   ```
   
   ## Context
   [For further context please refer to the 
following](https://lists.apache.org/thread.html/c330159c25dc6311d9d58f5ee395d85d76bac499c28beb937bc4d4eb@%3Cuser.couchdb.apache.org%3E)
   
   ## Your Environment
   * Version used: 2.0.0 (also reproducible in CouchDb 2.1.1)
   * Operating System and version (Desktop): Windows 10

----------------------------------------------------------------
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