CouchDB 同步错误 net::ERR_CONNECTION_RESET

CouchDB sync error net::ERR_CONNECTION_RESET

我正在尝试将本地 PouchDB 实例与 Google App Engine 上的远程 CouchDB 实例同步。

我有 ,但是当我尝试同步时出现以下错误:

replication paused (e.g. user went offline)
pouchdb-6.3.4.min.js:9 GET https://<ipaddress>:6984/pouchnotes/ net::ERR_CONNECTION_RESET

同步功能

PouchNotesObj.prototype.syncnoteset = function (start, end) {
    var start = new Date().getTime();
    document.getElementById("syncbutton").innerHTML = "Syncing...";

    var i, 
    that = this, 

    options = { 
    doc_ids:['1450853987668']   
  };

    if(start){ options.startkey = start; }
    if(end){ options.endkey = end; }

    PouchDB.sync(this.dbname, this.remote, { retry: true })
    .on('change', function (info) {
       console.log('change');
        document.getElementById("syncbutton").innerHTML = "Sync Notes";
    }).on('paused', function () {
       console.log('replication paused (e.g. user went offline)');
        document.getElementById("syncbutton").innerHTML = "Sync Notes";
    }).on('active', function () {
       console.log('replicate resumed (e.g. user went back online)');
        document.getElementById("syncbutton").innerHTML = "Sync Notes";
    }).on('denied', function (info) {
       console.log('a document failed to replicate, e.g. due to permissions');
        document.getElementById("syncbutton").innerHTML = "Sync Notes";
    }).on('complete', function (info) {
      console.log("Sync Complete");
      document.getElementById("syncbutton").innerHTML = "Sync Notes";
      that.viewnoteset();
      that.formobject.reset();    
      that.show(that.formobject.dataset.show);
      that.hide(that.formobject.dataset.hide);
      var end = new Date().getTime();
      console.log("Time Taken - " + (end - start) + " ms");
    }).on('error', function (error) {
      console.log("Sync Error:" + JSON.stringify(error));  
      alert("Sync Error:" + error);
      that.showerror(error);
    });   

}

编辑添加:我需要设置这个吗?

原来是I had not configured the firewall correctly.

对于偶然发现此问题的任何其他人:您只需要 SSH 隧道即可访问本地主机上的 Fauxton。您不需要它来访问 API.

如果你想access the API via https, the port is 6984 (not 5984), and for a non-Google App Engine server, you need something like Nginx set up to provide a SSL certificate。在 Google App Engine 上,提供了 SSL 证书。

但是你还需要configure CouchDB to enable SSL

Thanks to the guys at the CouchDB user mailing list for their input.