1

I try to replicate a CouchDB database with PouchDB but I have a problem when I try the following:

var localdb = new PouchDB('namedb');

var remote = new PouchDB('https://example.com:6984/namedb');

var rep = PouchDB.replicate( remote, localdb,{
    live: true,
    retry: true
}).on('change', function (info) {
    // handle change
}).on('paused', function (err) {
    // replication paused (e.g. replication up to date, user went offline)
}).on('active', function () {
    // replicate resumed (e.g. new changes replicating, user went back online)
}).on('denied', function (err) {
    // a document failed to replicate (e.g. due to permissions)
}).on('complete', function (info) {
    // handle complete
}).on('error', function (err) {
    // handle error
});

The console says :net::ERR_CONNECTION_CLOSED and

Object {status: 0, name: "unknown", message: "getCheckpoint rejected with ", result: Object}
message
:
"getCheckpoint rejected with "
name
:
"unknown"
result
:
Object
status
:
0
__proto__
:
Object
francescalus
  • 30,576
  • 16
  • 61
  • 96
toum
  • 11
  • 1
  • Are you connecting to a secure server that use HTTPS? You might want to watch [this](http://stackoverflow.com/questions/38780973/couchdb-sync-access-with-userid-and-password) similar problem. – Alexis Côté Apr 09 '17 at 16:15
  • Is that your actual PouchDB code? i.e. with no content for any of your handler functions? – Jonathan Hall Apr 11 '17 at 03:21
  • I found a solution to this problem. The problem came from the version of erlang used by couchDB 1.6.1. I have set up a reverse Nginx proxy and replication works in https – toum Apr 12 '17 at 09:53

0 Answers0